docker build --tag ubuntu18.04-ywshin .
docker run -dit --privileged --name ubuntu18.04-ywshin --restart=always -p 20000-20200:20000-20200 -v $PWD/dev:/root/dev ubuntu18.04-ywshin
docker exec -it ubuntu18.04-ywshin zsh
docker rm --force ubuntu18.04-ywshttps://github.com/SeriousMan-NJ/docker-ubuntu18.04/blob/master/README.mdhinIt is convenient to set volume to (your) development directory.
docker run -dit --name ubuntu18.04-ywshin --restart=always -v $HOME/development:/root/development ubuntu18.04-ywshinNo additional setting is needed!
Just connect into the docker container.
docker exec -it ubuntu18.04-ywshin zshIf you just connect into the docker container, you may meet tons of permission issues.
Follow the below steps in the docker container.
It is convenient to set volume to home directory.
docker run -dit --privileged --name ubuntu18.04-ywshin --restart=always -p 20000-20200:20000-20200 -v $HOME:$HOME ubuntu18.04-ywshinOpen sshd_config
vim /etc/ssh/sshd_configUncomment and edit following lines
Port 20022
ListenAddress 0.0.0.0
ListenAddress ::
PubkeyAuthentication yes
Password Authentication yes
Restart sshd server
service ssh restartCheck your $UID
echo $UID # NOTE: execute the command outside of docker container!create account with your $UID and $USER
For example, I've create ywshin account with 1003 UID.
adduser --gecos '' --uid 1003 ywshin
usermod -aG sudo ywshinssh into the docker container
ssh ywshin@docker-container-addresschsh -s /bin/zshIf you logout and login to the container, shell is changed to zsh!