docker-logentries icon indicating copy to clipboard operation
docker-logentries copied to clipboard

Switch to regular user

Open hazcod opened this issue 9 years ago • 1 comments

This example uses gosu to switch to a regular user when running the container. Running as root in a container is very dangerous and should be avoided.

Example usage:

docker build -t logger .
docker run -d \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --name logger \
    -e "GID=$(getent group docker | cut -d: -f3)" \
    -e "logs=xxx" \
    -e "stats=xxx" \
    -e "events=xxx" \
    --restart=on-failure:5 \
    --security-opt=no-new-privileges \
    --memory='1g' \
    --cpu-shares=1024 \
    logger

hazcod avatar May 31 '16 07:05 hazcod

Polling @StephenHynes7

hazcod avatar Sep 01 '16 08:09 hazcod