bridge: The default network driver. Containers get a private IP on a virtual bridge and reach the outside world via NAT. Bridge is Docker's default network driver. Each container gets a private IP address on a virtual network inside the host, and reaches the internet through network address translation. Containers on the same user-defined bridge network can reach each other by container name. Your app can connect to mysql:3306 instead of an IP address. Docker Compose creates such a network for every project automatically.
The built-in default bridge does not offer name resolution, which is why docker network create and Compose networks are the better choice. To make a service reachable from outside the host, publish its port with -p. Only publish what needs to be public. A database usually only needs to be reachable from the app container, not from the whole internet.
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.