Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-23409

ADD Command in Dockerfile Fails with BuildKit Enabled on Cloud Pipelines

      Issue Summary

      The ADD command is typically used to fetch content from a URL and copy it to a local directory specified in the Dockerfile. However, following the recent Docker Daemon 25 upgrade, BuildKit is enabled by default, which breaks this functionality in cloud pipelines.

      Steps to Reproduce

      1. Create a Dockerfile with the ADD command.
      2. Use the command ADD <public_repository_URL> /tmp.
      3. Build the Docker image using Docker services in cloud pipelines with DOCKER_BUILDKIT=1.

      Expected Results

      The repository content should be fetched and added to the /tmp directory.

      Actual Results

      The build fails with the following error:

      failed to load cache key: failed to init repo at /var/lib/docker/165536.165536/overlay2/r4bgug976866y3z0t486h7zn7/diff: exec: "git": executable file not found in $PATH 

      Workaround

      • Disable the Docker buildkit 
      DOCKER_BUILDKIT=0
      • Or use self-hosted runners with custom docker daemon (service) image. Where you can have buildkit enabled and can use ADD command to fetch the remote URL contents. 

          Form Name

            [BCLOUD-23409] ADD Command in Dockerfile Fails with BuildKit Enabled on Cloud Pipelines

            There are no comments yet on this issue.

              Unassigned Unassigned
              310cf44759d0 Suyog Rajendra Deshpande
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated: