Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to regular user #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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