Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tries to pull the image when image is available locally #425

Closed
genieai-vikas opened this issue Aug 4, 2021 · 6 comments
Closed

Tries to pull the image when image is available locally #425

genieai-vikas opened this issue Aug 4, 2021 · 6 comments

Comments

@genieai-vikas
Copy link

genieai-vikas commented Aug 4, 2021

Behaviour

Steps to reproduce this issue

  1. Create a dockerfile
FROM test/base-node

COPY package.json /app/sdadministrator/package.json
  1. Now we have to build the above dockerfile but as you can see test/base-node is the base image required.
  2. So I am pulling the base image from ECR and tag that image with test/base-node
  3. But even that image is present it's try to download the base image and gives error

Error: buildx failed with: error: failed to solve: test/base-node: pull access denied, repository does not exist or may require authorization: authorization status: 401: authorization failed

Expected behaviour

It should have used the docker image present locally to build

Actual behaviour

getting error
Error: buildx failed with: error: failed to solve: test/base-node: pull access denied, repository does not exist or may require authorization: authorization status: 401: authorization failed

  build-test:
    needs: build-base-node
    runs-on: ubuntu-latest 
    steps:
      - uses: actions/checkout@v1
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
          aws-region: eu-west-2
      - name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@master
      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-single-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-single-buildx
      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1
      - name: Build, tag, and push image to Amazon ECR
        id: build-image
        env:
          ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
          IMAGE_TAG: ${{needs.build-base-node.outputs.BRANCH_TAG}}
        run: |
          docker pull ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_BASE_IMAGE }}:$IMAGE_TAG
          docker tag ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_BASE_IMAGE }}:$IMAGE_TAG ${{ env.ECR_BASE_IMAGE }}
      - name: Build Base Node
        uses: docker/build-push-action@v2
        with:
          registry: ${{ steps.login-ecr.outputs.registry }}
          repository: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_BASE_IMAGE }}
          context: src/microservices/test
          builder: ${{ steps.buildx.outputs.name }}
          file: ./src/microservices/test/Dockerfile
          push: true
          tags: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_APP_REPOSITORY }}:${{needs.build-base-node.outputs.BRANCH_TAG}}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new

P.S In the dockerfile I can't have a full ECR registry something like this

FROM xxxxxxxxx.dkr.ecr.us-west-1.amazonaws.com/test/base-node

COPY package.json /app/sdadministrator/package.json
@crazy-max
Copy link
Member

crazy-max commented Aug 4, 2021

@genieai-vikas

docker/setup-buildx-action will create a builder using the docker-container driver so that's why test/base-node image can't be pulled because this builder doesn't have access to docker images.

To solve that you can use a local registry in your workflow.

P.S In the dockerfile I can't have a full ECR registry something like this

Why? If you can pull with docker pull ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_BASE_IMAGE }}:$IMAGE_TAG you can use a build-arg to pass this registry value to your Dockerfile at build time. Also our login-action is able to login against an ECR registry.

From what I see you could use the following workflow:

ARG BASE_IMAGE=test/base-node
FROM ${BASE_IMAGE}

COPY package.json /app/sdadministrator/package.json
  build-test:
    needs: build-base-node
    runs-on: ubuntu-latest 
    steps:
      - uses: actions/checkout@v2
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
          aws-region: eu-west-2
      - name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-single-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-single-buildx
      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1
      - name: Build Base Node
        uses: docker/build-push-action@v2
        with:
          context: src/microservices/sdgateway
          builder: ${{ steps.buildx.outputs.name }}
          file: ./src/microservices/sdgateway/Dockerfile
          build-args: |
            BASE_IMAGE=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_BASE_IMAGE }}:$IMAGE_TAG
          push: true
          tags: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_APP_REPOSITORY }}:${{needs.build-base-node.outputs.BRANCH_TAG}}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new

PS:

  • registry, repository inputs don't exist in docker/build-push-action@v2.
  • actions/checkout@v1 looks deprecated (last update 2019) so I suggest to use actions/checkout@v2
  • Don't use docker/setup-buildx-action@master but docker/setup-buildx-action@v1

@genieai-vikas
Copy link
Author

@crazy-max By this way, it is building the docker image without caching.

@crazy-max
Copy link
Member

@genieai-vikas Don't see how it would be different than your initial workflow. Do you have a link to your repo?

@genieai-vikas
Copy link
Author

@crazy-max Actually, It's a private repo but here is the logs(I changed some of the sensitive info). This logs is of the 2nd run so if you see the logs instead of done it supposed to have cached.
Also there is no change in the build time.

/usr/bin/docker buildx build --build-arg BASE_IMAGE=***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up --tag ***.dkr.ecr.eu-west-2.amazonaws.com/test-gatways/prod:dockerfile-clean-up --iidfile /tmp/docker-build-push-o7Efj8/iidfile --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache-new --file ./src/microservices/gateway/Dockerfile --builder builder-3f3091b9-6fa4-4b1a-98c6-b32f5e8c9c30 --push src/microservices/gateway
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 532B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 535B done
#2 DONE 0.0s

#3 [internal] load metadata for ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up
#3 ...

#4 [auth] sharing credentials for ***.dkr.ecr.eu-west-2.amazonaws.com
#4 DONE 0.0s

#3 [internal] load metadata for ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up
#3 DONE 1.2s

#6 [internal] load build context
#6 DONE 0.0s

#5 [1/8] FROM ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up@sha256:0a8ee2e609836a718c38428bae3306d40ebb81c4412dd4f9cb61e1adbf53d52e
#5 resolve ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up@sha256:0a8ee2e609836a718c38428bae3306d40ebb81c4412dd4f9cb61e1adbf53d52e done
#5 DONE 0.0s

#14 importing cache manifest from local:13752230533933761790
#14 DONE 0.0s

#6 [internal] load build context
#6 transferring context: 176.03kB 0.0s done
#6 DONE 0.0s

#5 [1/8] FROM ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up@sha256:0a8ee2e609836a718c38428bae3306d40ebb81c4412dd4f9cb61e1adbf53d52e
#5 DONE 0.1s

#5 [1/8] FROM ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up@sha256:0a8ee2e609836a718c38428bae3306d40ebb81c4412dd4f9cb61e1adbf53d52e
#5 sha256:7f3fe0f0a6d78bd11eece8c22d26df1bd4639f9d41014b170cdb4800d64a1400 0B / 298.47kB 0.2s
#5 sha256:f7bd8c73b972ec4e7a96f4fcee56173e8d1d7d906bd80c214993948af9bb9d92 0B / 239.04kB 0.2s
#5 sha256:7ed4951734e99b2c48ae97b4414939fb73a3e2dc7dbd48f78541aa516e701751 0B / 581B 0.2s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 0B / 51.03MB 0.2s
#5 sha256:7f3fe0f0a6d78bd11eece8c22d26df1bd4639f9d41014b170cdb4800d64a1400 298.47kB / 298.47kB 0.5s done
#5 sha256:f7bd8c73b972ec4e7a96f4fcee56173e8d1d7d906bd80c214993948af9bb9d92 239.04kB / 239.04kB 0.7s done
#5 sha256:7ed4951734e99b2c48ae97b4414939fb73a3e2dc7dbd48f78541aa516e701751 581B / 581B 0.7s done
#5 sha256:63517d64e1121fc6e5cd9e4aa89f73a30a3f9b37cc32abe024950fba84009495 0B / 68.21kB 0.2s
#5 sha256:9c2e5b1fb06422bceaaeeba37bccf6e548a648a1254ecb329b8a02be53ba4f4b 1.25kB / 1.25kB 0.2s done
#5 sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd 0B / 21.56MB 0.2s
#5 sha256:63517d64e1121fc6e5cd9e4aa89f73a30a3f9b37cc32abe024950fba84009495 68.21kB / 68.21kB 0.4s done
#5 sha256:4654193e733d9331550a10cd8f0b06f1a6f67ff8de345638c25cc90235117297 100B / 100B 0.2s done
#5 sha256:2e708aeb658ae778a6c31d08c413e12adb07e1982ea7d37feb4e4b7a5438ef70 0B / 99B 0.2s
#5 sha256:2e708aeb658ae778a6c31d08c413e12adb07e1982ea7d37feb4e4b7a5438ef70 99B / 99B 0.2s done
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 0B / 120.79MB 0.2s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 3.15MB / 51.03MB 1.4s
#5 sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd 8.39MB / 21.56MB 0.8s
#5 sha256:48fd78e4b5321d188146bc79a6b38f93ad9bc0958939a8ecbde58aebed044c7b 282B / 282B 0.2s done
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 9.44MB / 51.03MB 1.5s
#5 sha256:074ae49463c4f38ae0a7b325d47187e75bc59b07639d2e312d35b29aca1ee4e7 0B / 2.36MB 0.2s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 14.68MB / 51.03MB 1.7s
#5 sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd 19.92MB / 21.56MB 1.1s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 18.87MB / 51.03MB 1.8s
#5 sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd 21.56MB / 21.56MB 1.1s done
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 6.29MB / 120.79MB 0.8s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 24.12MB / 51.03MB 2.0s
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 0B / 35.91MB 0.2s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 30.41MB / 51.03MB 2.1s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 16.78MB / 120.79MB 1.1s
#5 sha256:074ae49463c4f38ae0a7b325d47187e75bc59b07639d2e312d35b29aca1ee4e7 2.36MB / 2.36MB 0.8s done
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 2.10MB / 35.91MB 0.3s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 35.65MB / 51.03MB 2.3s
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 8.39MB / 35.91MB 0.5s
#5 sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15 0B / 2.81MB 0.2s
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 41.94MB / 51.03MB 2.4s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 27.26MB / 120.79MB 1.4s
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 13.63MB / 35.91MB 0.6s
#5 sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15 2.81MB / 2.81MB 0.3s done
#5 extracting sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 48.23MB / 51.03MB 2.6s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 39.85MB / 120.79MB 1.7s
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 19.92MB / 35.91MB 0.8s
#5 extracting sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15 0.1s done
#5 sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 51.03MB / 51.03MB 2.8s done
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 24.12MB / 35.91MB 0.9s
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 30.41MB / 35.91MB 1.1s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 51.38MB / 120.79MB 2.0s
#5 sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 35.91MB / 35.91MB 1.3s done
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 57.67MB / 120.79MB 2.1s
#5 extracting sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 68.16MB / 120.79MB 2.4s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 74.45MB / 120.79MB 2.6s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 85.98MB / 120.79MB 2.9s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 92.27MB / 120.79MB 3.0s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 98.57MB / 120.79MB 3.2s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 108.63MB / 120.79MB 3.5s
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 120.79MB / 120.79MB 3.8s
#5 extracting sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 1.7s done
#5 extracting sha256:074ae49463c4f38ae0a7b325d47187e75bc59b07639d2e312d35b29aca1ee4e7
#5 sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 120.79MB / 120.79MB 4.3s done
#5 extracting sha256:074ae49463c4f38ae0a7b325d47187e75bc59b07639d2e312d35b29aca1ee4e7 0.6s done
#5 extracting sha256:48fd78e4b5321d188146bc79a6b38f93ad9bc0958939a8ecbde58aebed044c7b 0.0s done
#5 extracting sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9
#5 extracting sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 4.0s done
#5 extracting sha256:2e708aeb658ae778a6c31d08c413e12adb07e1982ea7d37feb4e4b7a5438ef70 done
#5 extracting sha256:4654193e733d9331550a10cd8f0b06f1a6f67ff8de345638c25cc90235117297 done
#5 extracting sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd
#5 extracting sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd 0.6s done
#5 extracting sha256:9c2e5b1fb06422bceaaeeba37bccf6e548a648a1254ecb329b8a02be53ba4f4b
#5 extracting sha256:9c2e5b1fb06422bceaaeeba37bccf6e548a648a1254ecb329b8a02be53ba4f4b 0.2s done
#5 extracting sha256:63517d64e1121fc6e5cd9e4aa89f73a30a3f9b37cc32abe024950fba84009495 0.0s done
#5 extracting sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a
#5 extracting sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 4.0s done
#5 DONE 14.2s

#5 [1/8] FROM ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up@sha256:0a8ee2e609836a718c38428bae3306d40ebb81c4412dd4f9cb61e1adbf53d52e
#5 extracting sha256:7ed4951734e99b2c48ae97b4414939fb73a3e2dc7dbd48f78541aa516e701751 done
#5 extracting sha256:f7bd8c73b972ec4e7a96f4fcee56173e8d1d7d906bd80c214993948af9bb9d92 0.0s done
#5 extracting sha256:7f3fe0f0a6d78bd11eece8c22d26df1bd4639f9d41014b170cdb4800d64a1400 0.1s done
#5 DONE 14.4s

#7 [2/8] COPY package.json /app/gateway/package.json
#7 DONE 2.5s

#8 [3/8] COPY package-lock.json /app/gateway/package-lock.json
#8 DONE 0.0s

#9 [4/8] RUN cd /app/gateway; npm ci --only=production
#9 3.055 
#9 3.055 > [email protected] preinstall /app/gateway
#9 3.055 > npx npm-force-resolutions
#9 3.055 
#9 4.769 npx: installed 6 in 1.638s
#9 13.70 
#9 13.70 > @apollo/[email protected] postinstall /app/gateway/node_modules/@apollo/protobufjs
#9 13.70 > node scripts/postinstall
#9 13.70 
#9 13.81 
#9 13.81 > [email protected] postinstall /app/gateway/node_modules/core-js
#9 13.81 > node -e "try{require('./postinstall')}catch(e){}"
#9 13.81 
#9 13.88 Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
#9 13.88 
#9 13.88 The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
#9 13.88 > https://opencollective.com/core-js 
#9 13.88 > https://www.patreon.com/zloirock 
#9 13.88 
#9 13.88 Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
#9 13.88 
#9 13.93 added 261 packages in 13.291s
#9 DONE 14.2s

#10 [5/8] WORKDIR /app
#10 DONE 0.1s

#11 [6/8] COPY . ./gateway/
#11 DONE 0.0s

#12 [7/8] WORKDIR /app/gateway
#12 DONE 0.0s

#13 [8/8] RUN npm run build:prod
#13 0.367 
#13 0.367 > [email protected] build:prod /app/gateway
#13 0.367 > npm run build-ts
#13 0.367 
#13 0.686 
#13 0.686 > [email protected] build-ts /app/gateway
#13 0.686 > tsc || true
#13 0.686 
#13 DONE 17.4s

#15 exporting to image
#15 exporting layers
#15 exporting layers 12.5s done
#15 exporting manifest sha256:b42aec0abed63351f59b9075f1e58051be10bbe8b91c6fb51a27e82888e1ae8f done
#15 exporting config sha256:2fe63d6dd9232ef201b888bca98f90b2d11065d6f5596233c06ca5023b40bbb0 done
#15 pushing layers
#15 pushing layers 2.4s done
#15 pushing manifest for ***.dkr.ecr.eu-west-2.amazonaws.com/test-gatways/prod:dockerfile-clean-up@sha256:b42aec0abed63351f59b9075f1e58051be10bbe8b91c6fb51a27e82888e1ae8f
#15 pushing manifest for ***.dkr.ecr.eu-west-2.amazonaws.com/test-gatways/prod:dockerfile-clean-up@sha256:b42aec0abed63351f59b9075f1e58051be10bbe8b91c6fb51a27e82888e1ae8f 0.4s done
#15 DONE 15.3s

#16 exporting cache
#16 preparing build cache for export 0.0s done
#16 writing layer sha256:074ae49463c4f38ae0a7b325d47187e75bc59b07639d2e312d35b29aca1ee4e7 0.1s done
#16 writing layer sha256:2e708aeb658ae778a6c31d08c413e12adb07e1982ea7d37feb4e4b7a5438ef70 done
#16 writing layer sha256:3c28d3b7e919888180b421d9ec00e2dc5bd23c6375d411a136649a969f586d5c
#16 writing layer sha256:3c28d3b7e919888180b421d9ec00e2dc5bd23c6375d411a136649a969f586d5c 0.2s done
#16 writing layer sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd
#16 writing layer sha256:41f454ce9fe35ed9365666ee5be3d7a0dea39c29f3768965f5658b387291a8cd 0.5s done
#16 writing layer sha256:4654193e733d9331550a10cd8f0b06f1a6f67ff8de345638c25cc90235117297 done
#16 writing layer sha256:48fd78e4b5321d188146bc79a6b38f93ad9bc0958939a8ecbde58aebed044c7b done
#16 writing layer sha256:6080668722c81deb5452181472af1bc5a7e3596b7287580ad3a9c76a03385e47 0.0s done
#16 writing layer sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9
#16 writing layer sha256:6215c0d25ab935e6e2ec2e6dcd4101cd9354d5d5c937976610051b9d078c51a9 3.0s done
#16 writing layer sha256:63517d64e1121fc6e5cd9e4aa89f73a30a3f9b37cc32abe024950fba84009495
#16 writing layer sha256:63517d64e1121fc6e5cd9e4aa89f73a30a3f9b37cc32abe024950fba84009495 done
#16 writing layer sha256:7ed4951734e99b2c48ae97b4414939fb73a3e2dc7dbd48f78541aa516e701751 done
#16 writing layer sha256:7f3fe0f0a6d78bd11eece8c22d26df1bd4639f9d41014b170cdb4800d64a1400 0.0s done
#16 writing layer sha256:9c2e5b1fb06422bceaaeeba37bccf6e548a648a1254ecb329b8a02be53ba4f4b 0.0s done
#16 writing layer sha256:a561ee7b55714bd21f54a2d2e77f52f9e51778abda92635bcbfa6346ccb2d9e5 0.0s done
#16 writing layer sha256:c6895e84c45597c6de5375ab7a892431826fac4c26eda98999ceb0b21c8bcfd0 done
#16 writing layer sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15 0.1s done
#16 writing layer sha256:cb5c32a59af4024a90a346b156142082f1f32d391a9e4c5f5f39e1321fe2e99d
#16 writing layer sha256:cb5c32a59af4024a90a346b156142082f1f32d391a9e4c5f5f39e1321fe2e99d 0.0s done
#16 writing layer sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a
#16 writing layer sha256:cdb6b670aaa7655fc5e028d70683492706b48a944d8e4208c7454e57d00b474a 1.2s done
#16 writing layer sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c
#16 writing layer sha256:cf8dc363e30fa6d6a24fafe0c593ea0447c0fbe2ec3f1a7e6c68fa8836d1556c 0.8s done
#16 writing layer sha256:f7bd8c73b972ec4e7a96f4fcee56173e8d1d7d906bd80c214993948af9bb9d92
time="2021-08-04T18:04:06Z" level=error msg="(*service).Write failed" error="rpc error: code = Canceled desc = context canceled" expected="sha256:c174b6259c2343e2cae8cfb9d1b87a7277b462c4d29b898538201c59f6a987d3" ref="sha256:c174b6259c2343e2cae8cfb9d1b87a7277b462c4d29b898538201c59f6a987d3" total=6497
#16 writing layer sha256:f7bd8c73b972ec4e7a96f4fcee56173e8d1d7d906bd80c214993948af9bb9d92 0.0s done
#16 writing config sha256:54d8892b1accdc3fabe889d254aeca22d8343a6bb7c4c0f6de3da3143c9289e5 done
#16 writing manifest sha256:c174b6259c2343e2cae8cfb9d1b87a7277b462c4d29b898538201c59f6a987d3 0.0s done
#16 DONE 6.0s

@crazy-max
Copy link
Member

@genieai-vikas Maybe you should cache all stages with mode=max:

cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Hard to tell without your Dockerfile. Also if your base image ***.dkr.ecr.eu-west-2.amazonaws.com/test/base-node:dockerfile-clean-up has been updated it will invalidate the cache for your image.

@UnstoppableMango
Copy link

Why doesn't this work with load: true? Is the second build-push-action working with a "fresh" set of images due to the docker-container driver, which just doesn't include the first exported image? I was trying this and getting sporadic results. I think the most confusing thing is that it succeeded at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants