Build a image
su
touch Dockfile
內容
From ubuntu
docker build -t imagename .
create a image
docker images
show build image
docker run -d –name imagename -t tagname
run a container
docker ps
show running container
——
docker images
show images
docker ps
show running container, get CONTAINER ID
docker stop [container id]
docker ps
check running image again
docker ps -a
show the whole container running and stopped
docker restart [container id]
restart a container
docker rm [container id]
remove a container
docker rm [container id] [container id] [container id]
remove container(s)
docker stop $(docker ps -a -q)
stop all running cainters
docker rm $(docker ps -a -q)
remove all cainters
docker rmi [imagename]
remove image
docker rmi [imagename] [imagename] [imagename]
remove image(s)
docker rmi $(docker images -a -q)
remove all images
du -sh /var/lib/docker
check images size
df -h /var/lib/docker
check available space
參考課程
隨機文章
- 行政部門就是這樣的心態 社會才不進步 (2013-04-09)
- 受保護的內容: PTT 養帳號,注意事項 (2017-03-04)
- Groupon 收掉之我思 (2015-09-25)
- 3156億的究極樂高:國艦國造,拼的是實力還是「誠意」? (2026-02-05)
- XP 不死只會凋零 (2014-03-02)








