From 05e83f61f856c81072c3de7df1344a67d8476a74 Mon Sep 17 00:00:00 2001 From: Alexander Zagniotov Date: Sat, 20 Jan 2024 12:49:58 -0800 Subject: [PATCH] Update config.yml --- .circleci/config.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e8bd737..3193bbff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -301,6 +301,8 @@ build_push_image_steps: &build_push_image_steps - run: name: Building and Pushing Multi Arch Docker images working_directory: ~/repo/docker/jdk<< parameters.jdk_version >> + # Best way to cache multi-stage + multi-platform image builds + # https://github.com/docker/buildx/discussions/1382#discussioncomment-7834832 command: | whoami ls -al @@ -308,9 +310,9 @@ build_push_image_steps: &build_push_image_steps docker context create tls-environment docker buildx create tls-environment --use - docker buildx build --cache-from=type=registry,ref=azagniotov/stubby4j:buildcache-arm64-jre<< parameters.jdk_version >> --cache-to=type=registry,ref=azagniotov/stubby4j:buildcache-arm64-jre<< parameters.jdk_version >> --platform linux/arm64 --load . - docker buildx build --cache-from=type=registry,ref=azagniotov/stubby4j:buildcache-amd64-jre<< parameters.jdk_version >> --cache-to=type=registry,ref=azagniotov/stubby4j:buildcache-amd64-jre<< parameters.jdk_version >> --platform linux/amd64 --load . - docker buildx build --cache-from=type=registry,ref=image:azagniotov/stubby4j:buildcache-amd64-jre<< parameters.jdk_version >> --cache-from=type=registry,ref=azagniotov/stubby4j:buildcache-arm64-jre<< parameters.jdk_version >> --build-arg REVISION=master --platform linux/amd64,linux/arm64 -f Dockerfile.arm64 -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> --output=type=image --push . + docker buildx build --cache-from=type=registry,ref=azagniotov/stubby4j:buildcache-arm64-jre<< parameters.jdk_version >> --cache-to=type=registry,ref=azagniotov/stubby4j:buildcache-arm64-jre<< parameters.jdk_version >> --build-arg REVISION=master -f Dockerfile.arm64 --platform linux/arm64 --load . + docker buildx build --cache-from=type=registry,ref=azagniotov/stubby4j:buildcache-amd64-jre<< parameters.jdk_version >> --cache-to=type=registry,ref=azagniotov/stubby4j:buildcache-amd64-jre<< parameters.jdk_version >> --build-arg REVISION=master -f Dockerfile.arm64 --platform linux/amd64 --load . + docker buildx build --cache-from=type=registry,ref=image:azagniotov/stubby4j:buildcache-amd64-jre<< parameters.jdk_version >> --cache-from=type=registry,ref=azagniotov/stubby4j:buildcache-arm64-jre<< parameters.jdk_version >> --build-arg REVISION=master -f Dockerfile.arm64 --platform linux/amd64,linux/arm64 -t azagniotov/stubby4j:latest-jre<< parameters.jdk_version >> --output=type=image --push . docker context rm tls-environment