Sign in

socket-proxy

3.4.9-r0-ls6

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.

docker pull ghcr.io/linuxserver-playground/socket-proxy:latest

Quick start · configure#

Pick the optional settings and mods you want, set your paths, ports and values, then copy the result.

Image
Identity

The user the application runs as and its timezone.

Mods

0 for socket-proxy, 0 universal mods suggested for it, and 13 other universal mods. Ticked mods join one DOCKER_MODS value in the order you tick them.

---
services:
  socket-proxy:
    image: ghcr.io/linuxserver-playground/socket-proxy:latest
    container_name: socket-proxy
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    restart: unless-stopped

Required settings only. Tick optional settings and mods to add them.

Install on …

Adding a store to your platform

Version tags#

TagLatest buildBuiltTests
:latestStable releasesbranch main · stable3.4.9-r0-ls6amd64 · arm64 passed

Architectures#

Pulling :latest picks the right one for your host automatically.

  • x86_64amd64-latest
  • arm64arm64v8-latest

Inside the latest image#

ghcr.io/linuxserver-playground/socket-proxy:3.4.9-r0-ls6

Explore this build
Base image
docker.io/alpine:3.24
Upstream version
3.4.9-r0
amd64 compressed
6.8 MB · 3 layers
arm64 compressed
7.0 MB · 3 layers
amd64 packages
20 · Alpine Linux v3.24
arm64 packages
20 · Alpine Linux v3.24
Tests
passed
Built
Reason
upstream check

In the fleet#

Live branches, their latest release, upstream version and next scheduled check.

socket-proxy on the fleet board

live branchesloading…

Branch → tagLast buildReleasedUpstreamDriftNext checkFlags
main → :latestsuccess
3.4.9-r0
? unknown––

Application setup#

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.

  • Never expose this container’s port to a public network. It should be treated the same way you would treat the docker socket or TCP endpoint.
  • Revoke access to any API section that you consider your service should not need.
  • To see the versions of the API your Docker daemon and client support, use docker version and check the API version.
  • Read the docs for the API version you are using for an explanation of all the available endpoints.

Podman / libpod API

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=1

Point 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).

Rootless Podman as a non-root user

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:

  • Socket ownership. The rootless Podman socket ($XDG_RUNTIME_DIR/podman/podman.sock) is owned by your host user. That user maps to root inside the container’s namespace, so a non-root user in the container cannot read it. Use --userns=keep-id:uid=65534,gid=65534 to map your host user onto UID/GID 65534 inside the container, so nobody owns the socket and can proxy it.
  • A writable /run. The entrypoint renders the HAProxy config into /run/haproxy at startup, so /run must be writable by the non-root user. Mount it as a tmpfs with mode=1777 (this also satisfies read-only operation).

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:latest

Or 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.

Parameters#

Environment variables#
VariableFunctionRequired
PUID=1000User IDrequired
PGID=1000Group IDrequired
TZ=Etc/UTCTimezonerequired

Read-Only Operation#

This image can be run with a read-only container filesystem. For details please read the docs.

Updating Info#

Most 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:

Via Docker Compose

  • Update images:

    • All images:
    docker compose pull
    • Single image:
    docker compose pull socket-proxy
  • Update containers:

    • All containers:
    docker compose up -d
    • Single container:
    docker compose up -d socket-proxy
  • You can also remove the old dangling images:

docker image prune

Via Docker Run

  • Update the image:
docker pull lscr.io/linuxserver/socket-proxy:latest
  • Stop the running container:
docker stop socket-proxy
  • Delete the container:
docker rm socket-proxy
  • You can also remove the old dangling images:
docker image prune

Image Update Notifications - Diun (Docker Image Update Notifier)

Tip

We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally#

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 --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Builds#

The newest five builds per branch, each with its CI report; 1 older release is on GitHub, listed below.

TagBuiltReasonChangeResultSize
3.4.9-r0-ls6main · 91c4a789upstream checkmixedsuccess6.8 MB amd647.0 MB arm64
3.4.8-r0-ls5main · 7a468694upstream checkmixedsuccess6.7 MB amd647.0 MB arm64
3.4.7-r0-ls4main · 18ee9b3eweekly package checkbasesuccess6.7 MB amd647.0 MB arm64
3.4.7-r0-ls3main · b9ad4bd8weekly package checkpackagessuccess6.7 MB amd647.0 MB arm64
3.4.7-r0-ls2main · 7fa4ab10release check or requested rebuildidenticalsuccess6.7 MB amd647.0 MB arm64
Older releases1Release, run record and run on GitHub
Older releases of socket-proxy, without a page on this site
TagBuiltLinks
3.4.7-r0-ls1mainRelease 3.4.7-r0-ls1 on GitHub (opens in a new tab)run.json of 3.4.7-r0-ls1Run that built 3.4.7-r0-ls1, on GitHub (opens in a new tab)

Mods#

Add a mod with DOCKER_MODS=<image>; separate several with |.

All mods for socket-proxy

No mod targets socket-proxy specifically; the 13 universal mods work with every image.

Support#

Questions about running socket-proxy? Start with the documentation and the community; open an issue for bugs.

  • Shell access whilst the container is running:
docker exec -it socket-proxy /bin/sh
  • To monitor the logs of the container in realtime:
docker logs -f socket-proxy
  • Container version number:
docker inspect -f '{{ index .Config.Labels "build_version" }}' socket-proxy
  • Image version number:
docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/socket-proxy:latest

Community project

Improve socket-proxy

This image is kept up by volunteers, and you can be one of them. You don't need to know how the pipeline works: point an AI agent at the harness and describe what you want. It reproduces the problem in your Docker, tests the change and drafts the pull request for you to check.

Ask your agent

  • Something is wrong with the socket-proxy image: <what you saw>. Reproduce it, fix it and draft the PR.
  • Add <package> to the socket-proxy image, test it and draft the PR.
  • Make a mod for socket-proxy that <what you need>, and test it.

Contributing an image Every way to help Get the harness (opens in a new tab)

Related

Browse all

modmanager

f03af0c1-ls6

Modmanager is a centralised tool for downloading and updating docker mods for all your other Linuxserver containers.

0 GitHub starsalpinearm64