Skip to content

Conversation

@hazcod
Copy link

@hazcod hazcod commented May 31, 2016

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
Copy link
Author

hazcod commented Sep 1, 2016

Polling @StephenHynes7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant