making user-based development environment on linux with docker
- Mounting user home folder (if using
host_script
)- User can use their home folder in container
- PID 1 is
init
process (if usinghost_script
) - Handling user with gosu
- file in container home folder have same owner as host (initial password in container is
snip
) - you can read/write file as same user of host
- file in container home folder have same owner as host (initial password in container is
- You just build gosu docker file after your develop environment docker image
- Change base image of
gosu/Dockerfile
which you need - Build
gosu
directory withdocker build -t gosu ./gosu
- run container with script (
user_script/docker_run.sh
)
- docker_run:
sudo docker_run.sh "image" "container-name-you-want'
- docker_exec:
sudo docker_exec.sh "container" "command"
- add user or group to sudoers (Make this users only able to run
docker_*
withsudo
)- This is for limit permission of added user.
- Build
gosu
directory withdocker build -t gosu ./gosu
for default image - Use base directory for install essential packages if you need