Public | Automated Build

Last pushed: 2 years ago
Short Description
Simple container to run something as a non-root user
Full Description

A simple Debian based image that creates a non-root user and then uses sudo to run the main command.

This image is designed to be used as a base for other application specific images.

Environment variables :

  • useruid - the user id, default is 1000
  • usergid - the group id, defaults to the uid
  • username - the user name, default is noname
  • userhome - the home directory, default /home/${username}
  • usertype - the type of user, normal or system, default is normal

Example using your own uid :

docker run -it --rm \
    --env "useruid=$(id -u)" \
    metagrid/notroot

Example using your own uid, gid and name :

docker run -it --rm \
    --env "useruid=$(id -u)" \
    --env "usergid=$(id -g)" \
    --env "username=$(id -un)" \
    metagrid/notroot

Creating a system user with specific uid, gid, name and home :

docker run -it --rm \
    --env "useruid=91" \
    --env "usergid=91" \
    --env "usertype=system" \
    --env "username=tomcat" \
    --env "userhome=/usr/share/tomcat" \
    metagrid/notroot
Docker Pull Command
Owner
metagrid
Source Repository

Comments (0)