Bitbucket Pipeline build execution hangs on docker build step
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
If your attempt to build a Docker image inside a Bitbucket Pipelines build results in hanging and incomplete execution, it might be due to insufficient memory available to the Docker service.
Cause
One potential cause for this behavior is the Docker service lacking adequate memory.
Solution
To resolve this issue, you can increase the memory available to the Docker service. Use the "2x" flag to double the memory, or configure a custom memory value. Here's an example setting 3 GB of memory for the Docker service:
1
2
3
4
5
6
7
8
9
10
11
12
13
definitions:
services:
docker:
memory: 3072 #3GB memory assigned to docker service
pipelines:
default:
- step:
size: 2x #2x memory flag
name: Using the 2x flag
services:
- docker
script:
- <Your Docker command here>
Reference:
Updated on April 8, 2025
Was this helpful?
Still need help?
The Atlassian Community is here for you.