# pull image
congtaojiang/ubuntu-ssh:20.04
# ceate a container, adjust --volume args
docker create \
--name sshInDocker \
--publish 8022:22 \
--volume `pwd`/workspace/:/home/nick/workspace \
congtaojiang/ubuntu-ssh:20.04
# start the container
docker start sshInDocker
# ssh into it
ssh -p 8022 nick@localhost
# stop the container
docker stop sshInDocker
# delete the container and image, if you don't need these anymore
docker rm sshInDocker
docker rmi congtaojiang/ubuntu-ssh:20.04
Content type
Image
Digest
Size
114.2 MB
Last updated
over 5 years ago
docker pull congtaojiang/ubuntu-ssh