9

Announcing support for Docker BuildKit in Bitbucket Pipelines

 2 years ago
source link: https://bitbucket.org/blog/announcing-support-for-docker-buildkit-in-bitbucket-pipelines
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Announcing support for Docker BuildKit in Bitbucket Pipelines

July 04, 2022 < 1 min read

Share

We are happy to announce that one of the top voted features for Bitbucket Pipelines, Docker BuildKit is now available. You can now build Docker images with the BuildKit utility.

With BuildKit you can take advantage of the various features it provides like:

  • Performance: BuildKit uses parallelism and caching internally to build images faster.
  • Secrets: Mount secrets and build images safely.
  • Cache: Mount caches to save re-downloading all external dependencies every time.
  • SSH: Mount SSH Keys to build images.

Configuring your bitbucket-pipelines.yaml

BuildKit is now available with the Docker Daemon service. It is not enabled by default and can be enabled by setting the environment variable DOCKER_BUILDKIT=1 in the pipelines configuration.

  pipelines:
  default:
    - step:
        script:
          - export DOCKER_BUILDKIT=1
          - docker build --secret id=mysecret,src=mysecret.txt .
        services:
          - docker

To learn more about how to set it up please refer to the support documentation and for information on Docker Buildkit, visit: Docker Docs ? Build images with BuildKit.

Please note:

  • Use multi-stage builds to utilise parallelism.
  • Caching is not shared across different builds and it’s limited to the build running on the same docker node where the build runs.
  • With BuildKit, secrets can be mounted securely as shown above.
  • For restrictions and limitations please refer to the restrictions section of our support documentation.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK