docker-engine安装好了,下一步该做什么?
1 從安裝和刪除語句說起
1 docker引擎安裝語句
sudo apt-get install? docker-ce? docker-ce-cli? containerd.io
2 docker引擎刪除語句
sudo apt-get remove docker docker-engine docker.io containerd runc
那么什么是 docker-ce? docker-ce-cli? containerd.io ?
2? Docker引擎:啟動-停止-查看
1? 要如何啟動docker引擎?
systemctl?start docker 或 sudo systemctl restart docker
2? 要如何關閉docker引擎?
systemctl?stop?docker
3? 如何查看docker引擎?
systemctl?status?docker
3 關于docker-hub:查看-拉取-登錄
1? 查看碼頭上各個公有倉庫的鏡象docker search nvidia?????????????????? ;查看帶nvidia的鏡像
docker search opencv? ?????????????? ;查看帶opencv的鏡像
2 拉取(下載)鏡像
docker pull??? name-image? ??????? ;從倉庫查到的鏡像名稱
3 進入自己的私有倉庫(在docker-hub上)
docker registry
4 關于Images:的鏡像操作(抽取、查看、實例化)
(一)產生和消滅images:
1 從hub上拉取鏡像
docker? pull??? name-image?
2? 刪除本地鏡像
docker? rmi? id(鏡像的標識)
3 創造本地鏡像
docker? build? -t? new_image_name:tag
(二) 查看本地鏡像
docker images
(三)從鏡像生成容器
docker? run? xxxxxxxxx語句
docker run -d
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq 80bd4b95a49d?(四)鏡像和本地文件轉化
4. 鏡像的導入導出(不規范) # 將本地的鏡像導出 docker save -o 導出的路徑 鏡像id # 加載本地的鏡像文件 docker load -i 鏡像文件 # 修改鏡像名稱 docker tag 鏡像id 新鏡像名稱:版本附錄:docker命令集合
Usage:? docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
????? --config string????? Location of client config files (default "/home/huatec/.docker")
? -c, --context string???? Name of the context to use to connect to the daemon (overrides
?????????????????????????? DOCKER_HOST env var and default context set with "docker context use")
? -D, --debug????????????? Enable debug mode
? -H, --host list????????? Daemon socket(s) to connect to
? -l, --log-level string?? Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default
?????????????????????????? "info")
????? --tls??????????????? Use TLS; implied by --tlsverify
????? --tlscacert string?? Trust certs signed only by this CA (default "/home/huatec/.docker/ca.pem")
????? --tlscert string???? Path to TLS certificate file (default "/home/huatec/.docker/cert.pem")
????? --tlskey string????? Path to TLS key file (default "/home/huatec/.docker/key.pem")
????? --tlsverify????????? Use TLS and verify the remote
? -v, --version??????????? Print version information and quit
docker管理命令:
? app*??????? Docker App (Docker Inc., v0.9.1-beta3)
? builder???? Manage builds
? buildx*???? Build with BuildKit (Docker Inc., v0.6.3-docker)
? config????? Manage Docker configs
? container?? Manage containers
? context???? Manage contexts
? image?????? Manage images
? manifest??? Manage Docker image manifests and manifest lists
? network???? Manage networks
? node??????? Manage Swarm nodes
? plugin????? Manage plugins
? scan*?????? Docker Scan (Docker Inc., v0.8.0)
? secret????? Manage Docker secrets
? service???? Manage services
? stack?????? Manage Docker stacks
? swarm?????? Manage Swarm
? system????? Manage Docker
? trust?????? Manage trust on Docker images
? volume????? Manage volumes
Commands:
? attach????? Attach local standard input, output, and error streams to a running container
? build?????? Build an image from a Dockerfile
? commit????? Create a new image from a container's changes
? cp????????? Copy files/folders between a container and the local filesystem
? create????? Create a new container
? diff??????? Inspect changes to files or directories on a container's filesystem
? events????? Get real time events from the server
? exec??????? Run a command in a running container
? export????? Export a container's filesystem as a tar archive
? history???? Show the history of an image
? images????? List images
? import????? Import the contents from a tarball to create a filesystem image
? info??????? Display system-wide information
? inspect???? Return low-level information on Docker objects
? kill??????? Kill one or more running containers
? load??????? Load an image from a tar archive or STDIN
? login?????? Log in to a Docker registry
? logout????? Log out from a Docker registry
? logs??????? Fetch the logs of a container
? pause?????? Pause all processes within one or more containers
? port??????? List port mappings or a specific mapping for the container
? ps????????? List containers
? pull??????? Pull an image or a repository from a registry
? push??????? Push an image or a repository to a registry
? rename????? Rename a container
? restart???? Restart one or more containers
? rm????????? Remove one or more containers
? rmi???????? Remove one or more images
? run???????? Run a command in a new container
? save??????? Save one or more images to a tar archive (streamed to STDOUT by default)
? search????? Search the Docker Hub for images
? start?????? Start one or more stopped containers
? stats?????? Display a live stream of container(s) resource usage statistics
? stop??????? Stop one or more running containers
? tag???????? Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
? top???????? Display the running processes of a container
? unpause???? Unpause all processes within one or more containers
? update????? Update configuration of one or more containers
? version???? Show the Docker version information
? wait??????? Block until one or more containers stop, then print their exit codes
總結
以上是生活随笔為你收集整理的docker-engine安装好了,下一步该做什么?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在Win10下安装python+tens
- 下一篇: Ubuntu 安装docker-engi