forked from jgrodziski/keycloak-clojure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-docker-images.sh
executable file
·30 lines (23 loc) · 1.13 KB
/
build-docker-images.sh
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
#!/usr/bin/env bash
ARTIFACT_NAME=$(clj -M:artifact-name)
ARTIFACT_ID=$(echo "$ARTIFACT_NAME" | cut -f1)
ARTIFACT_VERSION=$(echo "$ARTIFACT_NAME" | cut -f2)
JAR_FILENAME="$ARTIFACT_ID-$ARTIFACT_VERSION.jar"
clj -X:uberjar
docker buildx create --driver docker-container --name kc-clj-builder --node kc-clj-node --platform linux/amd64,linux/arm64
docker buildx use kc-clj-builder
docker buildx inspect --bootstrap
docker buildx --builder kc-clj-builder build --platform linux/arm64,linux/amd64 -t jgrodziski/keycloak-clojure-starter:latest --push .
if [ $? -eq 0 ]; then
echo "Successfully built \"keycloak-clojure\"'s docker image with JAR: jgrodziski/keycloak-clojure-starter:latest"
else
echo "Fail to built \"keycloal-clojure\"'s docker image!"
exit 1
fi
docker buildx --builder kc-clj-builder build --platform linux/arm64,linux/amd64 -t jgrodziski/keycloak-clojure-starter:$ARTIFACT_VERSION --push .
if [ $? -eq 0 ]; then
echo "Successfully built \"keycloak-clojure\"'s docker image with JAR: jgrodziski/keycloak-clojure-starter:$ARTIFACT_VERSION"
else
echo "Fail to built \"keycloal-clojure\"'s docker image!"
exit 1
fi