mac docker ubuntu image

Shell
# To start again after a reboot:
docker start ubuntu
docker exec -it ubuntu bash

# If you want save your changes:
docker commit ubuntu
docker images

# See the unnamed image and:
docker tag <imageid> myubuntu

# Then you can run another container using your new image.
docker run -it --name myubuntu myubuntu bash

# Or replace the former
docker stop ubuntu
docker rm ubuntu
docker run -it --name ubuntu myubuntu bash

# commit
docker ps -a
docker commit -m 'add ssh' -a 'goooajw' e5d8c1030724 ubuntu-ssh
docker image ls

# start with sshd
docker run -d -p 22:22 --name learn ubuntu-ssh /usr/sbin/sshd -D
Source

Also in Shell: