hosh / docker-ubuntu-uid

Docker image with Ubuntu 18.04 bionic set up to mount a directory on the host computer and run commands as the (non root) host UID

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

The Dockerfile in this repository builds a ubuntu:16.04 container (with apt-get update and apt-get upgrade run) which lets you run commands inside the container using a UID and GID which are passed in environment variables from outside the container, so that any files created in a volume mount can be created as the user and group who initiated docker run.

Read more at https://wtanaka.com/node/8271

To download: docker pull wtanaka/xenial-uid

Examples

Create a file called myfile in the current directory

docker run --rm -e "HOSTUID=`id -u`" -v "`pwd`:/work" wtanaka/xenial-uid touch myfile

Create a file with the correct uid and gid in the current directory

docker run --rm -e "HOSTUID=`id -u`" -e "HOSTGID=`id -g`" -v "`pwd`:/work" wtanaka/xenial-uid touch myfile

About

Docker image with Ubuntu 18.04 bionic set up to mount a directory on the host computer and run commands as the (non root) host UID


Languages

Language:Shell 83.1%Language:Dockerfile 16.9%