• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • Pipelines - Caching
    • None

      Issue Summary

      In Bitbucket Pipelines, docker-cached layers from previous builds are not being used in subsequent builds.

      The docker cache is successfully generated and uploaded in the initial pipeline. It's downloaded in the next step, but it's not used by docker, which is building the layers from scratch.

      Steps to Reproduce

      1. Create a pipeline and have a step configured to do a docker build , and to use the docker pre-defined cache
        pipelines:
          custom:
            test-build-docker-image:
              - step:
                  name: Build Docker image
                  script:
                    - docker build .
                  caches:
                    - docker
                  services:
                    - docker
        
      2. Run the pipeline the first time. It will generate a cache with the docker image built layers and upload it to Bitbucket.
      3. Run the pipeline a second time. It will now download the previously generated cache, but docker will not use the cache layers and will build each layer again from scratch.

      Expected Results

      Docker should use the cached layers from the previous build if no change was applied to that layer in the Dockerfile

      Actual Results

      Docker is using the previous cache layers.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            [BCLOUD-23193] Docker cache is not being used in Bitbucket Pipelines

            SET Analytics Bot made changes -
            UIS Original: 9095 New: 9096
            SET Analytics Bot made changes -
            UIS Original: 9091 New: 9095
            SET Analytics Bot made changes -
            UIS Original: 9088 New: 9091
            SET Analytics Bot made changes -
            UIS Original: 9090 New: 9088
            SET Analytics Bot made changes -
            UIS Original: 7976 New: 9090
            SET Analytics Bot made changes -
            UIS Original: 7974 New: 7976
            SET Analytics Bot made changes -
            UIS Original: 7971 New: 7974
            SET Analytics Bot made changes -
            UIS Original: 8690 New: 7971
            SET Analytics Bot made changes -
            UIS Original: 8687 New: 8690
            SET Analytics Bot made changes -
            UIS Original: 8684 New: 8687

              Unassigned Unassigned
              641e77b2eb21 Patrik S
              Affected customers:
              26 This affects my team
              Watchers:
              31 Start watching this issue

                Created:
                Updated: