From 49938430134c74bab99237e2270327bc68d14146 Mon Sep 17 00:00:00 2001 From: Alexander Zagniotov Date: Tue, 16 Jan 2024 21:45:17 -0800 Subject: [PATCH 1/3] Revert "Introduced on CircleCI a multi-arch Docker image build using BuildX (#465)" This reverts commit 6f09ed9d37749db8059bbe51515303f62ef4888c. --- .circleci/config.yml | 38 +++++++++++++++++++------------------- docker/jdk11/Dockerfile | 4 ++-- docker/jdk16/Dockerfile | 4 ++-- docker/jdk8/Dockerfile | 4 ++-- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 169a661d..da8e1074 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -262,34 +262,34 @@ build_push_image_steps: &build_push_image_steps - setup_remote_docker: version: 20.10.11 + # build the application image - run: - name: Install cURL on Alpine Linux - command: | - echo "" - apk --no-cache add curl && curl --version - - - run: - name: Install Docker Buildx + name: Building Docker image + working_directory: ~/repo/docker/jdk<< parameters.jdk_version >> + # https://support.circleci.com/hc/en-us/articles/360058095471-How-To-Use-Docker-Buildx-in-Remote-Docker- + # https://microservices.io/post/microservices/2022/01/18/build-multi-arch-docker-images-circleci.html command: | - mkdir -vp ~/.docker/cli-plugins/ - curl --silent -L "https://github.com/docker/buildx/releases/download/v0.12.0/buildx-v0.12.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx - chmod a+x ~/.docker/cli-plugins/docker-buildx - docker buildx version + echo "Creating a Docker context" + docker context create tls-environment + + echo "BuildX creates and uses the Docker context" + docker buildx create tls-environment --use + + echo "Starting Docker BuildX process .." + docker buildx build --platform linux/amd64,linux/arm64 --rm --no-cache -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> . - run: name: Authenticating to Docker Hub command: | echo "$DOCKER_HUB_PASSWORD" | docker login --username "$DOCKER_HUB_USER" --password-stdin + # deploy the image - run: - name: Building and Pushing Multi Arch Docker images + name: Pushing Docker image to Docker Hub working_directory: ~/repo/docker/jdk<< parameters.jdk_version >> command: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker context create tls-environment-jdk-<< parameters.jdk_version >> - docker buildx create tls-environment-jdk-<< parameters.jdk_version >> --use - docker buildx build --platform linux/arm64,linux/amd64 -f Dockerfile --rm --no-cache -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> --push . - docker context rm tls-environment-jdk-<< parameters.jdk_version >> + docker push azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> + docker buildx rm buildx-build smoke_test_steps: &smoke_test_steps steps: @@ -697,7 +697,7 @@ workflows: master-twelve-hour-jdk8: triggers: - schedule: - cron: "10 6,18 * * *" + cron: "10 7,19 * * *" <<: *filter_only_master jobs: - gradle_7_2_0_jdk8: @@ -725,7 +725,7 @@ workflows: master-twelve-hour-jdk16: triggers: - schedule: - cron: "20 8,20 * * *" + cron: "20 7,19 * * *" <<: *filter_only_master jobs: - gradle_7_2_0_jdk16: diff --git a/docker/jdk11/Dockerfile b/docker/jdk11/Dockerfile index f321fd96..2a7f2488 100644 --- a/docker/jdk11/Dockerfile +++ b/docker/jdk11/Dockerfile @@ -10,7 +10,7 @@ ######################################################################################## # Stage 1 : build the app ######################################################################################## -FROM gradle:7.2.0-jdk11-openj9@sha256:68d2abb7a3dafef89b9f387095ebe2f7059dca48c53d83fd9328bf5914ce14a6 AS BUILD_JAR_STAGE +FROM gradle:7.2.0-jdk11-openj9@sha256:6c628ab1edc7b733b4880804fcd27dc360fc350f333546924e64e3a34a009fa2 AS BUILD_JAR_STAGE ARG REVISION=master ENV GRADLE_USER_HOME=/home/gradle @@ -27,7 +27,7 @@ RUN git clone https://github.com/azagniotov/stubby4j.git && \ # Stage 2 : create the Docker final image ######################################################################################## # https://hub.docker.com/r/azul/zulu-openjdk-alpine -FROM azul/zulu-openjdk-alpine:11.0.21-11.68-jre-headless@sha256:95750d3048415315d22effd433373f1ecd543be17fb658c650207db6c837ec09 +FROM azul/zulu-openjdk-alpine:11.0.10-11.45.27-jre-headless@sha256:6cf54cbe8eef8a65eee89524dc9fcac4069425e87115ba908901f97c933703e8 ARG USER_ID=1001 ARG GROUP_ID=1001 diff --git a/docker/jdk16/Dockerfile b/docker/jdk16/Dockerfile index 2ebc79b9..1d17ac12 100644 --- a/docker/jdk16/Dockerfile +++ b/docker/jdk16/Dockerfile @@ -10,7 +10,7 @@ ######################################################################################## # Stage 1 : build the app ######################################################################################## -FROM gradle:7.2.0-jdk17@sha256:e9e90cc97b29423dda5a2ff5ed7787a31ab7f43660bd83993a880e33e1504c7b AS BUILD_JAR_STAGE +FROM gradle:7.2.0-jdk16-openj9@sha256:9620865af4f35026abfc9680603449296f832ea79da9a7f4e79d00989ccddcee AS BUILD_JAR_STAGE ARG REVISION=master ENV GRADLE_USER_HOME=/home/gradle @@ -27,7 +27,7 @@ RUN git clone https://github.com/azagniotov/stubby4j.git && \ # Stage 2 : create the Docker final image ######################################################################################## # https://hub.docker.com/r/azul/zulu-openjdk-alpine -FROM azul/zulu-openjdk-alpine:17-jre@sha256:1d30a12d48c20c02dbcfe9e01c5a41878066c4ddaf1e5cd768ea87f2ba212973 +FROM azul/zulu-openjdk-alpine:16.0.2-16.32.15-jre@sha256:d323c348f27b9458ec88fd69947560314df0fe059ff7acb3055f96b28f466a4d ARG USER_ID=1001 ARG GROUP_ID=1001 diff --git a/docker/jdk8/Dockerfile b/docker/jdk8/Dockerfile index f2847e20..e465fdd2 100644 --- a/docker/jdk8/Dockerfile +++ b/docker/jdk8/Dockerfile @@ -10,7 +10,7 @@ ######################################################################################## # Stage 1 : build the app ######################################################################################## -FROM gradle:7.2.0-jdk8-openj9@sha256:18fdc03987ce333918cf2badfcb677d27ac1ca667b014eef32ba77b48e58ab83 AS BUILD_JAR_STAGE +FROM gradle:7.2.0-jdk8-openj9@sha256:d4128edf5ac579f93e3149a9f89be3af779de1d3d85a9f25f25cb3d4b432b69a AS BUILD_JAR_STAGE ARG REVISION=master ENV GRADLE_USER_HOME=/home/gradle @@ -27,7 +27,7 @@ RUN git clone https://github.com/azagniotov/stubby4j.git && \ # Stage 2 : create the Docker final image ######################################################################################## # https://hub.docker.com/r/azul/zulu-openjdk-alpine -FROM azul/zulu-openjdk-alpine:8u362-8.68.0.21-jre-arm64@sha256:460ae0fb1205fdca85d909d58a31c4691c9d52764391031e387854c48ba7c6d8 +FROM azul/zulu-openjdk-alpine:8u282-8.52.0.23-jre-headless@sha256:91fe8ae651d5c778312e946e89f934240c2a80f55b7ca894d76daef8f5281375 ARG USER_ID=1001 ARG GROUP_ID=1001 From fb3064756b2c2a99c14796fd2fc4522ab4ff2d7f Mon Sep 17 00:00:00 2001 From: Alexander Zagniotov Date: Tue, 16 Jan 2024 21:45:49 -0800 Subject: [PATCH 2/3] Revert "Fixing buildx in config.yml (#464)" This reverts commit 50e41c304718e71729811cda5f84f7115b04abe0. --- .circleci/config.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index da8e1074..a88c46eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,22 +260,16 @@ build_push_image_steps: &build_push_image_steps - checkout - setup_remote_docker: - version: 20.10.11 + version: 20.10.7 # build the application image - run: name: Building Docker image working_directory: ~/repo/docker/jdk<< parameters.jdk_version >> # https://support.circleci.com/hc/en-us/articles/360058095471-How-To-Use-Docker-Buildx-in-Remote-Docker- - # https://microservices.io/post/microservices/2022/01/18/build-multi-arch-docker-images-circleci.html command: | - echo "Creating a Docker context" - docker context create tls-environment - - echo "BuildX creates and uses the Docker context" - docker buildx create tls-environment --use - - echo "Starting Docker BuildX process .." + docker context create buildx-build + docker buildx create --use buildx-build docker buildx build --platform linux/amd64,linux/arm64 --rm --no-cache -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> . - run: From 51827c5f6a0bdead37b4d4c6fe9f200d63f1be8b Mon Sep 17 00:00:00 2001 From: Alexander Zagniotov Date: Tue, 16 Jan 2024 21:46:02 -0800 Subject: [PATCH 3/3] Revert "Changes to config.yml to test the docker buildx (#463)" This reverts commit bd40621909b387e04d0bd8da2c5d8a69562470ea. --- .circleci/config.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a88c46eb..9e21f6f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -266,11 +266,7 @@ build_push_image_steps: &build_push_image_steps - run: name: Building Docker image working_directory: ~/repo/docker/jdk<< parameters.jdk_version >> - # https://support.circleci.com/hc/en-us/articles/360058095471-How-To-Use-Docker-Buildx-in-Remote-Docker- - command: | - docker context create buildx-build - docker buildx create --use buildx-build - docker buildx build --platform linux/amd64,linux/arm64 --rm --no-cache -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> . + command: docker build --rm --no-cache -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> . - run: name: Authenticating to Docker Hub @@ -281,9 +277,8 @@ build_push_image_steps: &build_push_image_steps - run: name: Pushing Docker image to Docker Hub working_directory: ~/repo/docker/jdk<< parameters.jdk_version >> - command: | - docker push azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> - docker buildx rm buildx-build + command: docker push azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> + smoke_test_steps: &smoke_test_steps steps: