Bitbucket "docker: not enabled" - Enable the Docker Service
A step ran a docker command without the docker service enabled. Docker-in-Pipelines is opt-in: without it, there is no daemon for the CLI to talk to.
What this error means
A docker build/docker run step fails with "Cannot connect to the Docker daemon" or a note that Docker is not enabled. Adding the docker service to the step makes the daemon available.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?Common causes
The docker service is not enabled on the step
Bitbucket only provides a Docker daemon when the step declares the docker service (or sets it in definitions). Without it, the docker CLI has no daemon socket.
Docker used where it is not supported
Some runner setups (e.g. certain self-hosted configurations) need Docker explicitly provisioned on the host; the cloud docker service does not apply there.
How to fix it
Enable the docker service on the step
pipelines:
default:
- step:
name: Build image
services:
- docker
script:
- docker build -t myapp .Allocate memory for Docker if needed
Heavy image builds may need more memory for the docker service; declare it in definitions.
definitions:
services:
docker:
memory: 2048How to prevent it
- Add the
dockerservice to every step that runs Docker commands. - Size the docker service memory for your largest image build.
- On self-hosted runners, bake Docker into the host image.