Using --network parameter in Docker commands in Bitbucket Pipelines
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
This article provides insights into the usage of the --network Docker command in Bitbucket Pipelines.
Solution
In Bitbucket Pipelines, the Docker commands can be utilized to create a network within the infrastructure. The following commands demonstrate the process:
Creating a bridge network named "my-test-network":
1
docker network create -d bridge my-test-network
(Optional) Assigning a subnet to the network:
1
docker network create -d bridge --subnet=172.28.0.0/16 my-test-network
(Optional) Attaching an IP address to a Docker container within the created network:
1
docker run -dit --name test-app --ip 172.28.0.22 --network=my-test-network
Notes:
Refer to the Docker network commands documentation for more details.
Explore the list of restricted Docker commands in Bitbucket Pipelines for additional information.
Updated on March 24, 2025
Was this helpful?
Still need help?
The Atlassian Community is here for you.