| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The LinuxServer.io team brings you another container release.
Find us at:
The Socket Proxy is a security-enhanced proxy which allows you to apply access rules to the Docker socket, limiting the attack surface for containers such as watchtower or Traefik that need to use it.
We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.
Simply pulling lscr.io/linuxserver/socket-proxy:latest should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
The architectures supported by this image are:
| Architecture | Available | Tag |
|---|---|---|
| x86-64 | ✅ | amd64-<version tag> |
| riscv64 | ✅ | riscv64-<version tag> |
| arm64 | ✅ | arm64v8-<version tag> |
| armhf | ❌ |
This container is conceptually based on https://github.com/Tecnativa/docker-socket-proxy and as such does not follow our usual container conventions. It does not support mods or custom scripts/services. It is designed to act as a drop-in replacement for the Tecnativa container.
The container should be run on the same docker network as the service(s) using it. Most containers that would normally connect to a mounted docker.sock can have their endpoint overridden using the DOCKER_HOST environment variable if they do not offer the option in their configuration; it should typically be pointed to tcp://socket-proxy:2375.
Podman exposes two API groups on the same socket: the Docker-compatible API (controlled by the existing env vars above) and the libpod-native API prefixed with /libpod/. The LIBPOD_* environment variables control access to the libpod endpoints independently of their Docker-compat equivalents.
For example, to use prometheus-podman-exporter, enable:
- LIBPOD_CONTAINERS=1
- LIBPOD_INFO=1
- LIBPOD_NETWORKS=1
- LIBPOD_PODS=1
- LIBPOD_VOLUMES=1
- LIBPOD_IMAGES=1
- LIBPOD_EVENTS=1Point the exporter at tcp://socket-proxy:2375 using CONTAINER_HOST. LIBPOD_PING and LIBPOD_VERSION are enabled by default (like their Docker-compat counterparts PING and VERSION).
Under rootless Podman the container process runs as root inside its user namespace by default. You can go a step further and drop root inside the container as well, running the proxy as an unprivileged user such as nobody (UID/GID 65534). Two things need to be handled for this to work:
Example podman run:
podman run -d \
--name=socket-proxy \
--user 65534:65534 \
--userns=keep-id:uid=65534,gid=65534 \
-e CONTAINERS=1 `#optional` \
-e LIBPOD_CONTAINERS=1 `#optional` \
-e POST=0 `#optional` \
-v $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock:ro \
-p 2375:2375 \
--read-only \
--tmpfs /run:rw,mode=1777 \
--restart unless-stopped \
lscr.io/linuxserver/socket-proxy:latestOr as a rootless Quadlet unit (~/.config/containers/systemd/socket-proxy.container), started with systemctl --user daemon-reload && systemctl --user start socket-proxy:
[Container]
ContainerName=socket-proxy
Image=lscr.io/linuxserver/socket-proxy:latest
User=65534:65534
UserNS=keep-id:uid=65534,gid=65534
Environment=CONTAINERS=1
Environment=LIBPOD_CONTAINERS=1
Environment=POST=0
Volume=%t/podman/podman.sock:/var/run/docker.sock:ro
PublishPort=2375:2375
ReadOnly=true
Tmpfs=/run:rw,mode=1777
[Install]
WantedBy=default.target(%t expands to $XDG_RUNTIME_DIR.) Enable the socket first with systemctl --user enable --now podman.socket.
Note
On SELinux-enforcing hosts (e.g. Fedora/RHEL), add --security-opt label=disable to the podman run (or SecurityLabelDisable=true to the Quadlet) so the container can access the mounted socket.
This image can be run with a read-only container filesystem. For details please read the docs.
To help you get started creating a container from this image you can either use docker compose or the docker cli.
Note
Unless a parameter is flaged as 'optional', it is mandatory and a value must be provided.
---
services:
socket-proxy:
image: lscr.io/linuxserver/socket-proxy:latest
container_name: socket-proxy
environment:
- ALLOW_ARCHIVE=0 #optional
- ALLOW_CHANGES=0 #optional
- ALLOW_EXPORT=0 #optional
- ALLOW_LOGS=0 #optional
- ALLOW_PAUSE=0 #optional
- ALLOW_RESTARTS=0 #optional
- ALLOW_STOP=0 #optional
- ALLOW_START=0 #optional
- ALLOW_TOP=0 #optional
- ALLOW_UNPAUSE=0 #optional
- AUTH=0 #optional
- BUILD=0 #optional
- COMMIT=0 #optional
- CONFIGS=0 #optional
- CONTAINERS=0 #optional
- DISABLE_IPV6=0 #optional
- DISTRIBUTION=0 #optional
- EVENTS=1 #optional
- EXEC=0 #optional
- IMAGES=0 #optional
- INFO=0 #optional
- LOG_LEVEL=info #optional
- NETWORKS=0 #optional
- NODES=0 #optional
- PING=1 #optional
- PLUGINS=0 #optional
- POST=0 #optional
- SECRETS=0 #optional
- SERVICES=0 #optional
- SESSION=0 #optional
- SWARM=0 #optional
- SYSTEM=0 #optional
- TASKS=0 #optional
- TZ=Etc/UTC #optional
- VERSION=1 #optional
- VOLUMES=0 #optional
- LIBPOD_CONTAINERS=0 #optional
- LIBPOD_EVENTS=0 #optional
- LIBPOD_EXEC=0 #optional
- LIBPOD_GENERATE=0 #optional
- LIBPOD_IMAGES=0 #optional
- LIBPOD_INFO=0 #optional
- LIBPOD_MANIFESTS=0 #optional
- LIBPOD_NETWORKS=0 #optional
- LIBPOD_PING=1 #optional
- LIBPOD_PLAY=0 #optional
- LIBPOD_PODS=0 #optional
- LIBPOD_SECRETS=0 #optional
- LIBPOD_SYSTEM=0 #optional
- LIBPOD_VERSION=1 #optional
- LIBPOD_VOLUMES=0 #optional
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
read_only: true
tmpfs:
- /rundocker run -d \
--name=socket-proxy \
-e ALLOW_ARCHIVE=0 `#optional` \
-e ALLOW_CHANGES=0 `#optional` \
-e ALLOW_EXPORT=0 `#optional` \
-e ALLOW_LOGS=0 `#optional` \
-e ALLOW_PAUSE=0 `#optional` \
-e ALLOW_RESTARTS=0 `#optional` \
-e ALLOW_STOP=0 `#optional` \
-e ALLOW_START=0 `#optional` \
-e ALLOW_TOP=0 `#optional` \
-e ALLOW_UNPAUSE=0 `#optional` \
-e AUTH=0 `#optional` \
-e BUILD=0 `#optional` \
-e COMMIT=0 `#optional` \
-e CONFIGS=0 `#optional` \
-e CONTAINERS=0 `#optional` \
-e DISTRIBUTION=0 `#optional` \
-e DISABLE_IPV6=0 `#optional` \
-e EVENTS=1 `#optional` \
-e EXEC=0 `#optional` \
-e IMAGES=0 `#optional` \
-e INFO=0 `#optional` \
-e LOG_LEVEL=info `#optional` \
-e NETWORKS=0 `#optional` \
-e NODES=0 `#optional` \
-e PING=1 `#optional` \
-e PLUGINS=0 `#optional` \
-e POST=0 `#optional` \
-e SECRETS=0 `#optional` \
-e SERVICES=0 `#optional` \
-e SESSION=0 `#optional` \
-e SWARM=0 `#optional` \
-e SYSTEM=0 `#optional` \
-e TASKS=0 `#optional` \
-e TZ=Etc/UTC `#optional` \
-e VERSION=1 `#optional` \
-e VOLUMES=0 `#optional` \
-e LIBPOD_CONTAINERS=0 `#optional` \
-e LIBPOD_EVENTS=0 `#optional` \
-e LIBPOD_EXEC=0 `#optional` \
-e LIBPOD_GENERATE=0 `#optional` \
-e LIBPOD_IMAGES=0 `#optional` \
-e LIBPOD_INFO=0 `#optional` \
-e LIBPOD_MANIFESTS=0 `#optional` \
-e LIBPOD_NETWORKS=0 `#optional` \
-e LIBPOD_PING=1 `#optional` \
-e LIBPOD_PLAY=0 `#optional` \
-e LIBPOD_PODS=0 `#optional` \
-e LIBPOD_SECRETS=0 `#optional` \
-e LIBPOD_SYSTEM=0 `#optional` \
-e LIBPOD_VERSION=1 `#optional` \
-e LIBPOD_VOLUMES=0 `#optional` \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--restart unless-stopped \
--read-only \
--tmpfs /run \
lscr.io/linuxserver/socket-proxy:latestContainers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.
| Parameter | Function |
|---|---|
| -e ALLOW_ARCHIVE=0 | `(/libpod)?/(containers |
| -e ALLOW_CHANGES=0 | `(/libpod)?/(containers |
| -e ALLOW_EXPORT=0 | `(/libpod)?/(containers |
| -e ALLOW_LOGS=0 | `(/libpod)?/(containers |
| -e ALLOW_PAUSE=0 | `(/libpod)?/(containers |
| -e ALLOW_RESTARTS=0 | `(/libpod)?/(containers |
| -e ALLOW_START=0 | `(/libpod)?/(containers |
| -e ALLOW_STOP=0 | `(/libpod)?/(containers |
| -e ALLOW_TOP=0 | `(/libpod)?/(containers |
| -e ALLOW_UNPAUSE=0 | `(/libpod)?/(containers |
| -e AUTH=0 | /auth |
| -e BUILD=0 | /build |
| -e COMMIT=0 | /commit |
| -e CONFIGS=0 | /configs |
| -e CONTAINERS=0 | /containers |
| -e DISTRIBUTION=0 | /distribution |
| -e DISABLE_IPV6=0 | Set to 1 to prevent binding to the IPv6 interface for legacy systems that cannot support IPv6. |
| -e EVENTS=1 | /events |
| -e EXEC=0 | /exec & /containers/{id}/exec |
| -e IMAGES=0 | /images |
| -e INFO=0 | /info |
| -e LOG_LEVEL=info | Possible values are: debug, info, notice, warning, err, crit, alert and emerg. Defaults to info. |
| -e NETWORKS=0 | /networks |
| -e NODES=0 | /nodes |
| -e PING=1 | /_ping |
| -e PLUGINS=0 | /plugins |
| -e POST=0 | When set to 0, only GET and HEAD operations are allowed, making API access read-only. |
| -e SECRETS=0 | /secrets |
| -e SERVICES=0 | /services |
| -e SESSION=0 | /session |
| -e SWARM=0 | /swarm |
| -e SYSTEM=0 | /system |
| -e TASKS=0 | /tasks |
| -e TZ=Etc/UTC | Set container timezone |
| -e VERSION=1 | /version |
| -e VOLUMES=0 | /volumes |
| Podman libpod API | |
| -e LIBPOD_CONTAINERS=0 | /libpod/containers |
| -e LIBPOD_EVENTS=0 | /libpod/events |
| -e LIBPOD_EXEC=0 | /libpod/exec |
| -e LIBPOD_GENERATE=0 | /libpod/generate (systemd/kube YAML generation) |
| -e LIBPOD_IMAGES=0 | /libpod/images |
| -e LIBPOD_INFO=0 | /libpod/info |
| -e LIBPOD_MANIFESTS=0 | /libpod/manifests |
| -e LIBPOD_NETWORKS=0 | /libpod/networks |
| -e LIBPOD_PING=1 | /libpod/_ping |
| -e LIBPOD_PLAY=0 | /libpod/play (kube play) |
| -e LIBPOD_PODS=0 | /libpod/pods (Podman-specific pod management) |
| -e LIBPOD_SECRETS=0 | /libpod/secrets |
| -e LIBPOD_SYSTEM=0 | /libpod/system |
| -e LIBPOD_VERSION=1 | /libpod/version |
| -e LIBPOD_VOLUMES=0 | /libpod/volumes |
| -v /var/run/docker.sock:ro | Mount the host docker socket into the container. |
| --read-only | Make the container filesystem read-only. |
| --tmpfs /run | Mount /run to tmpfs (RAM) to make it writeable. |
docker exec -it socket-proxy /bin/shdocker logs -f socket-proxydocker inspect -f '{{ index .Config.Labels "build_version" }}' socket-proxydocker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/socket-proxy:latestMost of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.
Below are the instructions for updating containers:
Update images:
docker compose pulldocker compose pull socket-proxyUpdate containers:
docker compose up -ddocker compose up -d socket-proxyYou can also remove the old dangling images:
docker image prunedocker pull lscr.io/linuxserver/socket-proxy:latestdocker stop socket-proxydocker rm socket-proxydocker image pruneTip
We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
If you want to make local modifications to these images for development purposes or just to customize the logic:
git clone https://github.com/linuxserver/docker-socket-proxy.git
cd docker-socket-proxy
docker build \
--no-cache \
--pull \
-t lscr.io/linuxserver/socket-proxy:latest .The ARM variants can be built on x86_64 hardware and vice versa using lscr.io/linuxserver/docker-qemu-static
docker run --rm --privileged lscr.io/linuxserver/docker-qemu-static --resetOnce registered you can define the dockerfile to use with -f Dockerfile.aarch64.
| Back | FazBrowse Home | New Git URL |