Home

Awesome

<!-- DO NOT EDIT THIS FILE MANUALLY --> <!-- Please read https://github.com/linuxserver/docker-socket-proxy/blob/main/.github/CONTRIBUTING.md -->

linuxserver.io

Blog Discord Discourse Fleet GitHub Open Collective

The LinuxServer.io team brings you another container release.

Find us at:

linuxserver/socket-proxy

Scarf.io pulls GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry Quay.io Docker Pulls Docker Stars Jenkins Build

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.

socket-proxy

Supported Architectures

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:

ArchitectureAvailableTag
x86-64amd64-<version tag>
arm64arm64v8-<version tag>
armhf

Application Setup

This container is 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, or running as a user other than root (or the docker user in a rootless environment). 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.

Read-Only Operation

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

Usage

To help you get started creating a container from this image you can either use docker compose or the docker cli.

docker compose (recommended, click here for more info)

---
services:
  socket-proxy:
    image: lscr.io/linuxserver/socket-proxy:latest
    container_name: socket-proxy
    environment:
      - ALLOW_START=0 #optional
      - ALLOW_STOP=0 #optional
      - ALLOW_RESTARTS=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
      - NETWORKS=0 #optional
      - NODES=0 #optional
      - PING=1 #optional
      - POST=0 #optional
      - PLUGINS=0 #optional
      - SECRETS=0 #optional
      - SERVICES=0 #optional
      - SESSION=0 #optional
      - SWARM=0 #optional
      - SYSTEM=0 #optional
      - TASKS=0 #optional
      - VERSION=1 #optional
      - VOLUMES=0 #optional
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped
    read_only: true
    tmpfs:
      - /run

docker cli (click here for more info)

docker run -d \
  --name=socket-proxy \
  -e ALLOW_START=0 `#optional` \
  -e ALLOW_STOP=0 `#optional` \
  -e ALLOW_RESTARTS=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 NETWORKS=0 `#optional` \
  -e NODES=0 `#optional` \
  -e PING=1 `#optional` \
  -e POST=0 `#optional` \
  -e PLUGINS=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 VERSION=1 `#optional` \
  -e 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:latest

Parameters

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

ParameterFunction
-e ALLOW_START=0/containers/{id}/start - This option will work even if POST=0
-e ALLOW_STOP=0/containers/{id}/stop - This option will work even if POST=0
-e ALLOW_RESTARTS=0/containers/{id}/stop, /containers/{id}/restart, and /containers/{id}/kill - This option will work even if POST=0
-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=0Set to 1 to prevent nginx binding to the IPv6 interface for legacy system that cannot support IPv6.
-e EVENTS=1/events
-e EXEC=0/exec & /containers/{id}/exec
-e IMAGES=0/images
-e INFO=0/info
-e NETWORKS=0/networks
-e NODES=0/nodes
-e PING=1/_ping
-e PLUGINS=0/plugins
-e POST=0When 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 VERSION=1/version
-e VOLUMES=0/volumes
-v /var/run/docker.sock:roMount the host docker socket into the container.
--read-onlyMake the container filesystem read-only.
--tmpfs /runMount /run to tmpfs (RAM) to make it writeable.

Support Info

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

Via Docker Run

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 using multiarch/qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static:register --reset

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

Versions