Running Docker commands in Bitbucket Pipelines
Bitbucket Pipelines allows you to run Docker commands within your build pipeline, creating Docker images from a Dockerfile in your repository and pushing it to a Docker registry.
Available Docker commands
Inside your Pipelines script, you can run the following Docker commands:
See the Docker command line reference for information on how to use these commands. Other commands, such as
docker run, are currently forbidden for security reasons on our shared build infrastructure.
Note that if you've been running commands against your own Docker daemon, this new feature doesn't prevent you from continuing to do that.
Pushing to a private registry
To push images to a private registry, you need to use
docker login to authenticate prior to calling docker push. See the limitations below for more information.
We have the following limitations with the alpha version of this feature:
- Pipelines does not currently wait for Docker to be available before starting your build script.
- Private registries require a call to
docker logineven if you have provided credentials to retrieve the build environment docker image in your Pipelines YAML. This is because these credentials are not currently shared with the Docker daemon which we independently start for you.
Please let us know if any of these limitations cause problems for you, as we're still determining what functionality to include in this feature.
If you have any feedback about this alpha feature, please email us at email@example.com.
Was this helpful?
Thanks for your feedback!