In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what are the basic operating commands for getting started with Docker. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
1. Related to docker services
Docker service management uses the systemctl command, and all services under Linux can be managed in the following ways.
Check whether the docker service starts systemctl status docker
Start the docker service systemctl start docker
Stop the docker service systemctl stop docker
Restart the docker service systemctl restart docker
Set docker service boot self-startup systemctl enable docker
View docker version docker-v
View docker system information docker info
II. Docker image management
View a list of docker images
Docker imagesdocker image ls
Save the mirror as a file
Docker save-o file name image name docker save-o centos8.tar centos:latest
Import saved image file
Docker load-I file name docker load-I centos8.tar
Pull or update a specified image from the image repository
Docker pull [OPTIONS] NAME [: TAG | @ DIGEST] docker pull centos # pull centos image
Delete images and delete multiple images at the same time. When deleting multiple images, the image name or id is separated by spaces.
Docker rmi [OPTIONS] IMAGE [IMAGE...]
Mark the local image and put it in a repository
Docker tag SOURCE_IMAGE [: TAG] TARGET_IMAGE [: TAG] docker tag hello-world:latest ay-a/hello:0.1
Push the image to the image repository
Docker push [OPTIONS] NAME [: TAG] docker push myimages:0.1
Docker build uses Dockerfile to create images (Dockerfile is not detailed here)
# the format of the command is as follows, and there are many options. You can view docker build [OPTIONS] PATH via docker build-- help | URL |-# create an image using the Dockerfile of the current directory, labeled testimages/test:v1docker build-t testimages/test:v1. III. Docker container life cycle management
Docker create creates a container but does not start it
# Command format docker create [OPTIONS] IMAGE [COMMAND] [ARG...] # create a container docker create named test using hello-world:latest-- name test hello-world:latest
Docker run creates and runs a new container
# Command format docker run [OPTIONS] IMAGE [COMMAND] [ARG...] # create a container named test using hello-world:latest and run docker run-- name test hello-world:latest
Docker start starts one or more containers that have stopped
# start the container docker start cea968a92c01 whose id is cea968a92c01
Docker stop stops a running container
# stop the container docker stop cea968a92c01 whose id is cea968a92c01
Docker restart restart the container
# restart the container docker restart cea968a92c01 whose id is cea968a92c01
Docker kill kills a running container
# Kill the container docker kill cea968a92c01 whose id is cea968a92c01
Docker rm deletes one or more containers, separated by spaces
# Delete the container docker rm cea968a92c01 whose id is cea968a92c01
Docker pause/unpause pauses / resumes all processes in the container
# pause all processes in a container with id as cea968a92c01 docker pause cea968a92c01# restore all processes docker unpause cea968a92c01 in containers with id as cea968a92c01
Docker exec executes commands in the container
# Command format docker exec [OPTIONS] CONTAINER COMMAND [ARG...] # run / bin/bash program docker exec-it 66c6f21aa2d1 / bin/bash in a container where id is 66c6f21aa2d1 4. Container operation
View a list of containers
Docker ps-a
Before you want to understand docker deeply, you must understand the concepts of container and virtual machine.
On the introduction to Docker what the basic operation commands are shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.