Proxying a local docker socket with endpoints access control and prometheus metrics for connections.
2.2K
Proxying a local docker socket based on HAProxy (no daemon or service system file modifications required) with endpoints access control using environment variables, connection statistics and prometheus metrics.
services:
docker-socket-haproxy:
image: lifailon/docker-socket-haproxy:amd64 # or arm64 tag
container_name: docker-socket-haproxy
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 2375:2375 # Docker API
- 2376:2376 # HAProxy stats and Prometheus metrics
environment:
- SOCKET_PATH=/var/run/docker.sock # Path to the Docker socket inside the container
- LOG_LEVEL=info # HAProxy proxy logging level (debug|info|warn|error)
# Enabled by default
- INFO=1 # /info — general information about the Docker daemon, version, plugins, limits
- PING=1 # /_ping — check for Docker API availability
- VERSION=1 # /version — get the API version and server information
# Disabled by default
- POST=0 # HTTP POST requests (e.g., to create containers)
- GRPC=0 # /grpc — Docker gRPC interface (experimental)
- EXEC=0 # /exec — running commands inside containers
- ALLOW_RESTARTS=0 # /containers/.../(restart|kill) — restart or stop the container
- ALLOW_START=0 # /containers/.../start — start stopped containers
- ALLOW_STOP=0 # /containers/.../stop — stop running containers
- AUTH=0 # /auth — responsible for logging in Registry via the Docker API
- CONTAINERS=0 # /containers — list of containers, their creation, deletion, inspection, etc.
- IMAGES=0 # /images — viewing, downloading, and deleting Docker images
- NETWORKS=0 # /networks — viewing, creating, and deleting Docker networks
- BUILD=0 # /build — building images via the API
- COMMIT=0 # /commit — creating an image from a container (docker commit)
- DISTRIBUTION=0 # /distribution — accessing the registry API (e.g., image metadata)
- EVENTS=0 # /events — Docker event stream (creating, starting, deleting containers)
- PLUGINS=0 # /plugins — managing Docker plugins
- VOLUMES=0 # /volumes — managing Docker volumes (creating, deleting, (view)
- SESSION=0 # /session — terminal sessions and interactive APIs
# Swarm
- SWARM=0 # /swarm — Swarm cluster settings and status
- NODES=0 # /nodes — information about nodes in the Swarm
- CONFIGS=0 # /configs — used in Swarm for configurations
- SECRETS=0 # /secrets — Docker Swarm secrets
- SERVICES=0 # /services — Docker Swarm service management
- SYSTEM=0 # /system — general Docker system information (resources, usage)
- TASKS=0 # /tasks — Swarm tasks (containers within services)
# HAProxy stats and Prometheus metrics
- STATS_USER=admin
- STATS_PASS=admin
- STATS_URI=/
- METRICS_URI=/metrics
Content type
Image
Digest
sha256:d029c684a…
Size
14.7 MB
Last updated
11 months ago
docker pull lifailon/docker-socket-proxy:arm64