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.mdhin
It 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-ywshin
No additional setting is needed!
Just connect into the docker container.
docker exec -it ubuntu18.04-ywshin zsh
If 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-ywshin
Open sshd_config
vim /etc/ssh/sshd_config
Uncomment and edit following lines
Port 20022
ListenAddress 0.0.0.0
ListenAddress ::
PubkeyAuthentication yes
Password Authentication yes
Restart sshd server
service ssh restart
Check 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 ywshin
ssh into the docker container
ssh ywshin@docker-container-address
chsh -s /bin/zsh
If you logout and login to the container, shell is changed to zsh!