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
參考課程
隨機文章
- 自動刪除舊檔案 / 老舊備份 Linux上的指令不錯用 (2022-07-10)
- 卡巴斯基CEO說 麥金塔的安全性落後微軟10年 (2012-04-26)
- OMV 6 , Docker / Portainer 差異蠻大的 (2023-07-21)
- MSN LIVE在XP PRO SP3中無法方安 (2008-05-17)
- 爛新聞~到底有沒有在審稿啊 (2008-12-25)