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 introduces the knowledge about "how to use Docker container image-related commands". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
I. Introduction to Docker
Docker is an open platform for developing, publishing and running applications. Docker can separate applications from infrastructure (i.e. no more need for underlying support) so we can deliver software quickly. With Docker, we can manage infrastructure just like we manage applications. Docker official
Docker Advantages:
Flexibility: Docker can be used to containerize applications even if they are too complex.
Lightweight: Because Docker containers use a host-shared kernel, no additional hardware support is required.
Application isolation: containers run with Docker that isolate the interaction between different applications (i.e., each container is independent)
1. Docker architecture
Docker uses a C/S architecture, Docker Client is used to communicate with Docker daemons (daemons are servers), and daemons can be used to build, run, and distribute Docker containers. Docker Client and daemons can run on the same system, or Docker Client can be remotely connected to daemons. Use the REST API protocol and communicate via UNIX sockets or network interfaces. Another Docker Client is Docker Compose (an application that allows us to compose a set of containers).
Docker architecture doesn't need to be a big deal because Docker clients and Docker daemons generally run on the same server.
2. Docker Three Core
The three cores of Docker to be said here are image image, container container, repository repository; this can be said to be the most important part of Docker.
1) Mirrors
Docker images are read-only templates for Docker container runtimes, images can be used to create Docker containers (each image consists of a series of layers)
2) Containers
Docker mainly uses containers to run applications. A Docker container can be said to contain the environment needed for an application to run. Every Docker container is created from an image. A container can be said to be a running instance created by a mirror, which can be started, stopped, deleted, etc. And each container is isolated from each other, ensuring safe platforms.
3) Warehouse
Docker repository is mainly used to store images centrally. When we create our own image, we can use the push command to upload it to a public or private repository. The advantage of this is that when we need to use this image on another server, we can pull it directly from the repository (relatively fast).
Docker installation
Preparations:
hostname OS IP address package DockerCentOS 7.x192.168.1.4docker-ce-19.03.12 docker-ce-cli-19.03.121. download Docker package 1) install base package [root@Docker ~]# yum -y install yum-utils device-mapper-persistent-data lvm22) configure yum source of Docker [root@Docker ~]#wget-O/etc./yum.repos.d/CentOS-Base.repo http: //mirrors.aliyun.com/repo/Centos-7.repo[root@Docker ~]# yum-config-manager \--add-repo \https://download.docker.com/linux/centos/docker-ce.repo3) Install Docker
We can use yum list docker-ce --showduplicates| sort -r command to view all versions of Docker.
[root@Docker ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo[root@Docker ~]# yum-config-manager \--add-repo \https://download.docker.com/linux/centos/docker-ce.repo4) Start Docker and verify [root@Docker ~]# systemctl enable docker --now #configure boot and boot [root@Docker ~]# docker version #View Docker version
5) Configure Docker Accelerator [root@Docker ~]# cat /zhangsan/index.html[root@Docker ~]# curl 127.0.0.1:1888
-p: Specifies the port on which the container is running (host port followed by port within the container;-P is a single letter used to allow the container to implement random port mapping)
-v: Specify the data volume, which is equivalent to the mount command. We can mount the host directory into the container (you can add multiple-v to configure multiple data volumes)
"Docker container image related commands how to use" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
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.