Friday, November 26, 2021
Home CONTAINERIZATION Can docker container access the host network?

Can docker container access the host network?

Yes, A docker container can access the host network if it is started with the correct parameters and Docker host policies/controls allowing to do so. When a container is starting you can set the networking option with –network host option likedocker container run --rm -d --network host --name my_nginx nginx command.

In this way, the container network stack will be the same as the docker host network stack. When a process tries to listen to a port in the container namespace it will actually try to listen on the Docker host network interface.

Previous articleHello world!
Next articleWhen to use volume in Docker?
Burak Cansizoglu
Burak is working as a freelance Cloud/DevOps consultant. He performed different roles during his professional career track. He has more than 12 years of experience in the finance, telecommunication and government sectors. He likes to learn new technologies and wants to share his knowledge, experiences with the community. He likes all lean, agile initiatives. And he believes that the DevOps mindset and DevOps transformation will bring more agility to the Enterprises as well as employees.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular

What is Buildah? Build, manage and modify your images

Buildah builds images and working containers. What is Buildah? Buildah is a command-line tool for...

Skopeo: Master Management Tool of Container Images and Registries

Skopeo: Master Management Tool of Container Image and Registries What is Skopeo? Skopeo is a...

Podman: Alias Docker or Bitter Rival?

What is Podman? Containerization is undoubtedly a game-changing technology. Today companies often prefer cloud-native applications running within...

Jenkins. Invalid agent type “docker” specified. Must be one of [any, label, none]

Jenkins is working with plugins, if you didn't install Docker and Docker Pipeline plugins you can get this error. "Jenkins. Invalid agent...

Recent Comments