1.docker命令
docker version (獲取docker版本號)
docker login (登入docker,根據提示填寫hub.docker.com的賬號和密碼)
2.映象操作命令
docker search tutorial (查詢docker映象,tutorial為映象名)
docker pull learn/turorial (下載映象, learn/turorial為映象名)
docker commit 72d0ff864e05 jie3306/ping (生成映象,72d0ff864e05:容器ID,jie3306/ping:映象名)
docker push jie3306/ping (推送映象到docker倉庫,jie3306/ping:映象名(push之前需要先docker login進行登入))
3.容器操作命令
docker run learn/tutorial echo "Hello world" (生成容器,learn/tutorial:映象名 ,echo "Hello world":容器執行的shell)
docker ps -l (容器列表, -l:命令引數)
docker inspect 5070 (檢視容器詳情, 5070:容器ID前幾位字元(容器id只需填寫前幾位即可))
docker start 96b64da0c203 (容器啟動)
docker stop 96b64da0c203(容器停止)
docker logs 96b64da0c203 (檢視容器日誌)
docker stats 96b64da0c203 (檢視容器所佔的系統資源)
docker exec MyWordPress ps -ef (容器內部執行命令,MyWordPress:容器名, ps -ef:shell命令)
docker exec -it MyWordPress /bin/bash(進入容器內部,MyWordPress:容器名)