Lightweight container running a restricted Docker unix socket proxy
8.8K
Lightweight container running a restricted Docker unix socket proxy
| Image size | RAM usage | CPU usage |
|---|---|---|
| 5.82MB | 10MB | Low |
Exposing /var/run/docker.sock to a Docker container requiring it (such as netdata) involves
security concerns and the container should be limited in what it can do with docker.sock.
You can enable an endpoint with the -a argument. Currently supported endpoints are:
/containers/json and /containers/{name}/json/images/json , /images/{name}/json and /images/{name}/history/networks and /networks/{name}/volumes and /volumes/{name}/services and /services/{id}/tasks and /tasks/{name}/events/info/version/_pingTo combine arguments, repeat them like this: -a info -a version
The following is in example for netdata, such that it can resolve
the container names found in the cgroups filesystem.
docker run -d --net=none \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /yourpath:/tmp/docker-proxy-acl \
qmcgaw/docker-proxy-acl-alpine -a containers
A new socket file is hence created at /yourpath/docker.sock with only the
/containers/json and /containers/{name}/json endpoints allowed.
This socket file can then be passed to the netdata container, with an additional option like this:
-v /yourpath/docker.sock:/var/run/docker.sock
You can also use docker-compose:
version: '3'
services:
docker-proxy:
build: .
image: qmcgaw/docker-proxy-acl-alpine
container_name: docker-proxy
volumes:
- /yourpath/docker-proxy-acl:/tmp/docker-proxy-acl
- /var/run/docker.sock:/var/run/docker.sock
command: -a containers
network_mode: none
restart: always
Content type
Image
Digest
Size
2.2 MB
Last updated
over 7 years ago
docker pull qmcgaw/docker-proxy-acl-alpine