Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda