Skip to content

Docker image with Alpine Linux 3.7 set up to mount a directory on the host computer and run commands as your own UID instead of root

License

Notifications You must be signed in to change notification settings

cliwrap/alpine-37

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status CircleCI Docker Stars Docker Pulls Docker Automated build Docker Cloud Build Status Image Version CII Best Practices

The Dockerfile in this repository builds an alpine:3.7 container 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.

To download: docker pull cliwrap/alpine-37

Examples

Create a file called myfile in the current directory

docker run --rm -e "HOSTUID=`id -u`" -v "`pwd`:/work" cliwrap/alpine-37 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" cliwrap/alpine-37 touch myfile

About

Docker image with Alpine Linux 3.7 set up to mount a directory on the host computer and run commands as your own UID instead of root

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project