host: The container shares the host's network stack directly — no isolation, no port mapping needed. Linux only. With the host network mode, a container shares the host machine's network directly. There is no separate container IP and no port mapping; an app listening on port 8080 in the container is on port 8080 of the host.
It removes a small amount of network overhead and makes some tools easier, such as network monitoring agents that need to see the host's traffic.
What should you keep in mind with host?
It also removes isolation. The container can reach every service on the host, and port conflicts between containers become your problem. Host networking only works this way on Linux; on Docker Desktop for Mac and Windows it behaves differently. For normal applications, a bridge network with published ports is the safer default.
Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.
Use this skill when creating, modifying, or debugging Docker Compose configurations, even if the user just says they need to wire services together, add a database to their stack, or set up a local development environment with multiple containers. Covers service definitions, health checks, dependency ordering, volumes, networks, environment variables, and development overrides.
Use this skill when writing, reviewing, or optimizing Dockerfiles, even if the user just says their image is too large, their build is slow, or they need to harden a container for production. Covers multi-stage builds, layer caching, .dockerignore, non-root users, and image size optimization.