From 320de598eb69278df9119e3a812de7d8dd1e3b9b Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sun, 15 Jan 2023 14:25:57 +0100 Subject: [PATCH] ok now it should cache --- .circleci/config.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53313f4..7502b75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,7 +92,6 @@ jobs: build: machine: image: ubuntu-2004:current - docker_layer_caching: true working_directory: ~/photos resource_class: large @@ -108,12 +107,26 @@ jobs: - run: name: create docker builder - command: docker buildx create --use + command: docker buildx create --use --driver=docker-container + + - restore_cache: + keys: + - buildx-photos-circleci - run: name: build and push to docker hub - command: docker buildx build --progress=plain --push --platform linux/arm64,linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH . - #command: docker buildx build --push --platform linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH . + command: | + docker buildx build --progress=plain --push --platform linux/arm64,linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH \ + --cache-to=type=local,mode=max,dest=/tmp/dockercache \ + --cache-from=type=local,src=/tmp/dockercache . + - run: + name: prune cache + command: docker buildx prune --keep-storage=2gb --verbose + + - save_cache: + key: buildx-photos-circleci + paths: + - /tmp/dockercache # build-arm: # machine: