In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
What is docker?
Docker is an open source application container engine, developers can package their applications into containers, and then migrate to docker applications on other machines to achieve rapid deployment. If a failure occurs, the service can be quickly restored through mirroring.
Environmental preparation
Operating system: CentOS 7.6.1810
Software source: Aliyun image (the software source of docker-ce can be found on Aliyun image station, and the speed of using domestic source is relatively fast)
Install docker-ce
If you do not have a physical machine, you can first use a virtual machine to learn. Operating system installation, skip (many online tutorials).
1. Installation dependency
Docker relies on some of the necessary tools of the system and can be installed in advance.
Yum install-y yum-utils device-mapper-persistent-data lvm2
2. Add software sources
Yum-config-manager-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3. Install docker-ce
Yum clean all yum makecache fastyum-y install docker-ce
4. Start the service
Start the service through systemctl
Systemctl start docker
5. View the installation version
The installation is successful, and you can use docker version to check the current version after starting the service.
Starting from the use of the docker command, tease out the following commands:
Parameter usage syntax example search searches for image docker search image name docker search nginxpull in docker hub downloads image to local docker pull image name: tagdocker pull nginx:latestpush pushes specified image to docker image server docker push local image: tagdocker push nginx:V1images views all local docker images docker imagesdocker imaegsrun creation container And run docker run parameter image name: tagdocker-d run nginx:latesthistory to view the image formation process docker history local image name: tagdocker history nginx:V1start start container docker start container ID or container name docker strat 3d265463456stop stop container docker stop container ID or container name docker stop nginxbuild create image docker build parameter image name: tag dockerfile directory docker build-t nginx:V1 / opt/attach current shell connection running container docker attach container name docker Attach nginxcommit saves the current container as image / snapshot docker commit container ID or container name new image name: tagdocker commit nginx nginx:V2cp container and host copy files docker cp container name: file directory / name local directory docker cp / var/www/html/ nginx:/var/www/htmlcreate create container but do not start container docker create parameter image name docker create nginx:V1diff view container changes docker diff container ID or container Name docker diff nginxexec execute commands in container docker exec parameters container ID or name command docker exec centos echo '123'login login docker mirror source server docker login server address docker loginlogout exit login image source server docker logoutdocker logoutlogs output log information of the current container docker logs container ID or name docker logs nginxport view container port mapping docker port container ID or name docker port nginxps list container docker ps parameter Docker ps-arestart restart container docker restart container ID or name docker restart nginxrm delete container docker rm parameter container ID or name docker rm nginxrmi delete local image docker rmi image name: tagdocker rmi nginx:V1save save image as tar package docker save-o tar file name image name: tagdocker save-o nginx.tar nginx:V1top view process information in container docker top container ID or name docker top nginxversion view docker software version docker versiondocker versionevents view docker server Server real-time docker events parameter docker events-- since= "1577321423" import imports docker from tar file to image docker import parameter tar file image name: tagdocker import nginx.tar nginx:V2export exports image from docker to tar file docker export parameter image name: tag tar file docker export nginx:V2 nginx2.tarinfo view docker system information docker infodocker infoinspect view container details docker inspect container ID or name docker inspect nginxgrep IPAddresskill kill the running container docker Kill parameter container ID or name docker kill nginxload loaded from tar file as docker image docker load-I tar file image name: tagdocker load-I nginx2.tar nginx:V3pause pause container docker pause container ID/ name docker pause nginxtag image tagged docker tag image name: tag new image name: tagdocker tag nginx:V3 mynginx:V4unpause unpaused container docker unpause container ID/ name docker unpause nginxwait blocking operation until the container stops Then print out its exit code docker wait CONTAINERdocker wait CONTAINER
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.