Configure Docker networking for containers including bridge, overlay, and service discovery
Configure Docker networks for container communication and service discovery. Creates custom bridge, overlay, or macvlan networks with specific subnets and isolation settings when you need to connect containers or troubleshoot network issues.
/plugin marketplace add pluginagentmarketplace/custom-plugin-docker/plugin install pluginagentmarketplace-docker-container-assistant@pluginagentmarketplace/custom-plugin-dockerThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/network-config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyMaster Docker networking concepts and configuration for container communication, service discovery, and network isolation.
Configure and troubleshoot Docker networks for development and production environments with proper isolation and service discovery.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| driver | enum | No | bridge | bridge/overlay/host/macvlan |
| subnet | string | No | - | Custom subnet CIDR |
| internal | boolean | No | false | Internal-only network |
| Driver | Use Case | Multi-Host | Encryption |
|---|---|---|---|
| bridge | Single host, default | No | No |
| overlay | Swarm, multi-host | Yes | Optional |
| host | Max performance | No | N/A |
| macvlan | Physical network | No | No |
| none | Disable networking | No | N/A |
# Create network with custom subnet
docker network create \
--driver bridge \
--subnet 172.28.0.0/16 \
--gateway 172.28.0.1 \
my_network
# Run container on network
docker run -d --name app \
--network my_network \
nginx:alpine
services:
frontend:
image: nginx:alpine
networks:
- public
ports:
- "80:80"
backend:
image: node:20-alpine
networks:
- public
- private
expose:
- "3000"
database:
image: postgres:16-alpine
networks:
- private # Internal only
networks:
public:
driver: bridge
private:
driver: bridge
internal: true # No external access
# Containers can reach each other by service name
services:
app:
image: myapp
environment:
# Use service name as hostname
DATABASE_HOST: database
CACHE_HOST: redis
database:
image: postgres:16-alpine
redis:
image: redis:alpine
# Create encrypted overlay
docker network create \
--driver overlay \
--attachable \
--opt encrypted \
my_overlay
# Map host:container
docker run -p 8080:80 nginx
# Bind to specific interface
docker run -p 127.0.0.1:8080:80 nginx
# Random host port
docker run -P nginx
# UDP port
docker run -p 53:53/udp dnsserver
| Error | Cause | Solution |
|---|---|---|
network not found | Typo or deleted | Create network |
address in use | Port conflict | Change port |
cannot reach | Wrong network | Check network membership |
DNS failed | Service not ready | Add health checks |
docker network lsdocker network inspect <net>docker exec app nslookup backenddocker network lsdocker inspect <container>nslookup from containerdocker port <container># List networks
docker network ls
# Inspect network
docker network inspect my_network
# Test connectivity
docker exec app ping -c 3 database
# Check DNS
docker exec app nslookup backend
# View port mappings
docker port container_name
# Enter container network namespace
docker exec -it app sh
# Check DNS resolution
cat /etc/resolv.conf
nslookup database
# Check connectivity
ping -c 3 backend
curl http://backend:3000/health
Skill("docker-networking")
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.