Skip to content

Commit

Permalink
Build container images with buildx (#4147)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeberhard committed Apr 4, 2023
1 parent 745ff09 commit 947b1d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# -------------------------
FROM ghcr.io/oracle/oraclelinux:9-slim AS jre-build

ENV JAVA_URL_X64="https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_linux-x64_bin.tar.gz"
ENV JAVA_URL_AARCH64="https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_linux-aarch64_bin.tar.gz"
ENV JAVA_URL_X64="https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_linux-x64_bin.tar.gz"
ENV JAVA_URL_AARCH64="https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_linux-aarch64_bin.tar.gz"

RUN set -eux; \
microdnf -y install gzip tar; \
Expand Down
24 changes: 2 additions & 22 deletions buildAndPushImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,8 @@ echo "Building image '$name' ..."

# BUILD AND PUSH THE IMAGE (replace all environment variables)
BUILD_START=$(date '+%s')
${WLSIMG_BUILDER:-docker} build $PROXY_SETTINGS --pull --platform linux/amd64 --tag $name-amd64 -f $SCRIPTPATH/Dockerfile $SCRIPTPATH || {
echo "There was an error building the amd64 image."
exit 1
}
${WLSIMG_BUILDER:-docker} push $PROXY_SETTINGS $name-amd64 || {
echo "There was an error pushing the amd64 image."
exit 1
}
${WLSIMG_BUILDER:-docker} build $PROXY_SETTINGS --pull --platform linux/arm64 --tag $name-arm64v8 -f $SCRIPTPATH/Dockerfile $SCRIPTPATH || {
echo "There was an error building the arm64v8 image."
exit 1
}
${WLSIMG_BUILDER:-docker} push $PROXY_SETTINGS $name-arm64v8 || {
echo "There was an error pushing the arm64v8 image."
exit 1
}
${WLSIMG_BUILDER:-docker} manifest create $PROXY_SETTINGS $name --amend $name-amd64 --amend $name-arm64v8 || {
echo "There was an error building the manifest."
exit 1
}
${WLSIMG_BUILDER:-docker} manifest push $PROXY_SETTINGS $name || {
echo "There was an error pushing the manifest."
${WLSIMG_BUILDER:-docker} buildx build $PROXY_SETTINGS --pull --push --platform linux/amd64,linux/arm64 --tag $IMAGE_NAME -f $SCRIPTPATH/Dockerfile $SCRIPTPATH || {
echo "There was an error building and pushing the image."
exit 1
}
BUILD_END=$(date '+%s')
Expand Down

0 comments on commit 947b1d7

Please sign in to comment.