Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
Docker for Mac: Host network and port publishing

I am running Docker for Mac. When I run

docker run -d --rm --name nginx -p 80:80 nginx:1.10.3

I can access Nginx on port 80 on my Mac. When I run

docker run -d --rm --name nginx --network host -p 80:80 nginx:1.10.3

I can not.

Is it possible to use both "--network host" and publish a port so that it is reachable from my Mac?

Alternatively, can I access Nginx from my Mac via the IP of the HyperKit VM?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Without the --network flag the container is added to the bridge network by default; which creates a network stack on the Docker bridge (usually the veth interface).

If you specify --network host the container gets added to the Docker host network stack. Note the container will share the networking namespace of the host, and thus all its security implications.

Which means you don't need to add -p 80:80, instead run...
docker run -d --rm --name nginx --network host nginx:1.10.3

and access the container on http://127.0.0.1

The following link will help answer the HyperKit question and the current limitations:
https://docs.docker.com/docker-for-mac/networking/

There is no docker0 bridge on macOS

Because of the way networking is implemented in Docker for Mac, you cannot see a docker0 interface in macOS. This interface is actually within HyperKit.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda