Skip to content

bertoverflow/docker-dynamic-uid-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-dynamic-uid-example

Example project to show how to use a dynamic uid when starting a container. The docker run command has a --user parameter, but this has some limitations. See here for a good article about the topic: https://denibertovic.com/posts/handling-permissions-with-docker-volumes/

This technique (at least similar) is also used in the official docker images (for example for redis): https://github.com/docker-library/redis/tree/master/5.0

Build the image

docker build . -t docker-dynamic-uid-example

Run the container

This will run the container with the uid of the host-user, so using volumes will not be a problem.

docker run -it -e LOCAL_USER_ID=`id -u $USER` docker-dynamic-example bash

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published