Useful commands for writing a Dockerfile and docker image management
Start the docker service
$ sudo service docker startCheck available images
[6] https://ithelp.ithome.com.tw/articles/10238415
$ docker images
Check available container
$ docker ps
Execute existing image
$ docker exec -it [image ID] /bin/bash
Delete all the images
Delete all the images
List
$ docker images -a
$ docker images -a
Delete
$ docker stop $(docker ps -a -q)
$ docker rmi [Image ID] [Image ID]
$ docker rmi -f $(docker images -aq)
Stop and remove all containers
List
List
$ docker ps -a
Delete
$ docker stop $(docker ps -a -q)
$ docker rm [ID_or_Name] [ID_or_Name]
$ docker rm [ID_or_Name] [ID_or_Name]
$ docker rm $(docker ps -a -q)
Save and load
$ docker save -o XXX.tar container
$ docker load < XXX.tar
Reference:
[5] pytorch-cuda-docker[6] https://ithelp.ithome.com.tw/articles/10238415
留言
張貼留言