I have a self-hosted docker which runs on bitbucket pipeline. I wanted to make sure that this docker container should runs in network host mode.
Where do I need to specify to make sure the pipeline container opens in that network mode?
G'day, @Nikhil Chowdary Gutlapalli
Welcome to the community!
May I know by self-hosted do you mean our Bitbucket runner? If yes, I believe the following KB should be able to help you achieve in using --network in your pipeline build:
Using --network parameter in Docker commands in Bitbucket Pipelines
Regards,
Syahrul
Hi @Syahrul
Thanks for your response. Yes, I mean Bitbucket runner.
The following KB link you provided is redirecting to this same page. Can you please check the link again?
Best,
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wanted to provide more info.
I have created an image using DockerFile and I pushed the image to the DockerHub.
And in my bitbucket-pipeline.yml, I am calling that docker image.
This is the basic code:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Nikhil Chowdary Gutlapalli
I apologize for the invalid link, please check the following link:
Using --network parameter in docker
That said, the runner's container starts with the --network host
option. However, during the build process, the build container is launched as a sidecar with bridge networking, instead of host networking. This configuration is part of the internal networking setup to facilitate communication between containers associated with the runners.
To ensure proper network functionality, please follow these steps:
sysctl net.ipv4.ip_forward
iptables
to ensure that traffic from the Docker bridge network is correctly routed through the host network:
iptables -t nat -L -n -v
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.