-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild-local-docker.sh
More file actions
executable file
·45 lines (37 loc) · 1.52 KB
/
build-local-docker.sh
File metadata and controls
executable file
·45 lines (37 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Script to build KSML Docker image locally for testing
# This script prepares build artifacts and builds the Docker image using the main Dockerfile
set -e # Exit on any error
mvn package -DskipITs=true
# Prepare build artifacts
echo " - Creating build-output/ directory"
echo " - Copying ksml-runner JAR, libraries, and license files"
mkdir -p build-output
cp ksml-runner/target/ksml-runner*.jar build-output/
cp -r ksml-runner/target/libs build-output/
cp ksml-runner/NOTICE.txt build-output/
cp LICENSE.txt build-output/
GRAALVM_JDK_VERSION=${GRAALVM_JDK_VERSION:-23.0.2}
# Download graalvm tarfiles
if [ ! -f graalvm-amd64.tar.gz ]; then
echo "Downloading GraalVM for AMD64"
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${GRAALVM_JDK_VERSION}/graalvm-community-jdk-${GRAALVM_JDK_VERSION}_linux-x64_bin.tar.gz -O graalvm-amd64.tar.gz
fi
if [ ! -f graalvm-arm64.tar.gz ]; then
echo "Downloading GraalVM for ARM64"
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${GRAALVM_JDK_VERSION}/graalvm-community-jdk-${GRAALVM_JDK_VERSION}_linux-aarch64_bin.tar.gz -O graalvm-arm64.tar.gz
fi
# Create builder if it doesn't exist
if ! docker buildx ls --format {{.Name}} | grep -E "^ksml$"; then
echo "Creating Docker buildx builder 'ksml'..."
docker buildx create --name ksml --use
else
echo "Using existing Docker buildx builder 'ksml'..."
docker buildx use ksml
fi
docker buildx build \
--load \
-t axual/ksml:local \
--target ksml \
-f Dockerfile \
.