1
0
mirror of https://github.com/Tecnativa/docker-socket-proxy synced 2025-07-06 15:22:35 +00:00
docker-socket-proxy/docker-entrypoint.sh
Jake Howard c73447028f
Create a docker group on startup with the correct GID
This allows haproxy to read the socket, whilst running as a non-privileged user.

The container itself needs to run as root to create the group, but haproxy itself changes its own group after startup.
2022-11-29 09:15:34 +00:00

11 lines
253 B
Bash
Executable File

#!/bin/sh
set -e
# Create a group with the same gid as the docker socket
export DOCKER_GID=$(stat -c "%g" $SOCKET_PATH)
addgroup -g $DOCKER_GID docker
# Run the original entrypoint - Our work here is done.
exec /usr/local/bin/docker-entrypoint.sh $@