action-docker-layer-caching
action-docker-layer-caching copied to clipboard
Rinning with the caching Slower then without a cache
Hi, The image bellow shows that this plugin makes the build really slower. When I run without the plugin, I get better results. Im sure the problem is on my side, what am I doing wrong? Thanks

This is the code:
jobs:
build-push-gcr:
name: Build and Push to GCP
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: satackey/[email protected]
continue-on-error: true
- uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
project_id: ${{ secrets.PROJECT_ID }}
- name: Build Docker Image
run: DOCKER_BUILDKIT=1 docker build -t ${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }} -f ./infra/build/${{ inputs.APP_NAME }}/Dockerfile .
- name: Configure Docker Client
run: |-
gcloud auth configure-docker --quiet
gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
- name: Push Docker Image to Container Registry (GCR)
run: |-
docker tag ${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }} gcr.io/${{ secrets.PROJECT_ID }}/${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }}
docker push gcr.io/${{ secrets.PROJECT_ID }}/${{ inputs.APP_NAME }}/${{ inputs.BRANCH_NAME }}
The problem is with the docker push command. I have the same issue, the caching also caches those images, and when loading it loads those as well, even though they are irrelevant.
Not sure how to fix this though...
Yes, I just put a step at the end after pushing those images to delete the tag image for the registry.
However do you guys know if there is a way to clear the images that are already in the cache?
Yes, I just put a step at the end after pushing those images to delete the tag image for the registry.
However do you guys know if there is a way to clear the images that are already in the cache?
Can you share the snippet on how you clear the images?
You can clear images from cache by changing the cache key and restore-keys.