In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable container, then publish them to any popular Linux or Windows machine, or virtualize them. Containers are completely sandboxed and do not have any interface to each other.
The main content of 1.docker
(1) .docker is a cs architecture
(2) .docker mainly: network storage monitoring of image container warehouse
(3) .docker is a software packaging technology.
2.docker mirroring basic command
1.docker search Nginx (search image)
[root@docker03] # docker search nginxNAME DESCRIPTION STARS OFFICIAL AUTOMATEDnginx Official build of Nginx. 12314 [OK] jwilder/nginx-proxy Automated Nginx reverse proxy for docker con... 1698 [OK] richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of … [OK] linuxserver/nginx An Nginx container, brought to you by LinuxS... eighty-three
2.docker pull nginx (download the image from the official website warehouse without adding latest, and download the latest version by default)
[root@docker03 ~] # docker pull nginxUsing default tag: latestlatest: Pulling from library/nginx000eee12ec04: Pull complete
3.docker push (upload Image)
[root@docker03 ~] # docker push nginx
4.docker images (view existing local images)
[root@docker03 ~] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEnginx latest 231d40e811cd 2 weeks ago 126MB
5.docker rmi (remove Mirror)
[root@docker03 ~] # docker rmi nginx:latestUntagged: nginx:latestUntagged: nginx@sha256:50cf965a6e08ec5784009d0fccb380fc479826b6e0e65684d9879170a9df8566Deleted: sha256:231d40e811cd970168fb0c4770f2161aa30b9ba6fe8e68527504df69643aa145
6.docker tag (tag the image)
[root@docker03 ~] # docker tag nginx:latest nginx:v1
7.docker load-I docker_kod.tar.gz (local image import)
[root@docker03 ~ / docker] # lsdocker_ kod.tar.gz [root @ docker03 ~ / docker] # [root@docker03 ~ / docker] # docker load-I docker_kod.tar.gz b5e11aae8a8e: Loading layer [= = >] 202.9MB/202.9MB
8.docker import (import image, images does not have a mirror name and label)
[root@docker03 ~ / docker] # docker import docker_kod.tar.gz [root@docker03 ~ / docker] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE c1863e2b0717 35 seconds ago 627MB
9.docker save (save image to current directory)
[root@docker03 ~ / docker] # docker save nginx:latest-o docker_nginx.tar.gz
10.docker inspect nginx:v1 (View Mirror Properties)
[root@docker03 ~ / docker] # docker inspect nginx:v1
11.docker image prune (clean up unused images and pull half of the images, delete the image cache)
[root@docker03 ~ / docker] # docker image prune WARNING! This will remove all dangling images.Are you sure you want to continue? [y/N] yDeleted Images:deleted: sha256:c1863e2b07171e582113544e6c19660cd3fee7d6f1d89401529f8472732c8e33deleted: sha256:56d69e4a0819cab19e224724de86de73c8dfcd8ee5f01e08288b20cfb49c4d52
12.docker changes the time zone (restart the container takes effect)
[root@22732407347e /] # / bin/cp / usr/share/zoneinfo/Asia/Shanghai / etc/localtime
13. Delete Mirror
[root@docker03 ~] # docker image prune
Other
1) docker container run
The docker container run-it ubuntu / bin/bash command starts a Ubuntu container in the foreground and runs Bash Shell.
Ctrl-PQ breaks the link between the Shell and the container terminal and keeps the container running (UP) in the background after exiting.
2) docker container ls
3) docker container exec
The docker container exec-it bash command starts a Bash Shell process inside the container and connects to the Shell.
For this command to take effect, the image used to create the container must contain a Bash Shell.
4) docker container stop
This command does this by sending SIGTERM signals to processes in the container with a PID of 1.
If the process is not cleaned and stopped within 10 seconds, a SIGKILL signal is then sent to force the container to stop.
Docker container stop can take the container ID and the container name as parameters.
5) docker container start
6) docker container rm
7) docker container inspect
The command to start the new container. The minimalist form of this command accepts mirrors and commands as parameters. The image is used to create the container, and the command is the application that you want the container to run.
Used to list all containers in the UP state. If you use the-a flag, you can also see the container in the Exited state.
Used to start a new process in a running container. This command is useful when connecting the Docker host Shell to a running container terminal.
This command stops the running container and sets the state to Exited (0).
Restart the container in the Exited state. You can specify the name of the container or ID in the docker container start command.
Delete containers that are not running. You can specify the container to be deleted by the container name or ID. It is recommended that you first use the docker container stop command to stop the container, and then use docker container rm to complete the deletion.
Displays configuration details and runtime information for the container. This command takes the container name and container ID as the main parameters.
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.