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 > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to configure the official source of docker and install docker with yum. It is very detailed and has a certain reference value. Interested friends must read it!
How to configure the docker official source and install docker with yum
First, the official installation document of docker:
Https://docs.docker.com/engine/installation/linux/centos/
From the documentation given by docker, we can see that it only configures a yum source of docker, and then installs docker through this source; in this document, we use manual configuration.
The way
Configure a source for docker:
1. Add a new yum configuration file for docker; touch / etc/yum.repos.d/docker.repo
Touch / etc/yum.repos.d/docker.repo
2. Docker.repo is as follows
[docker-ce-stable] name=Docker CE Stable-$basearchbaseurl= https://download.docker.com/linux/centos/7/$basearch/stableenabled=1gpgcheck=0 # I set this to 0, which means I trust the source Do not inspect its rpm gpgkey= https://download.docker.com/linux/centos/gpg[docker-ce-stable-debuginfo]name=Docker CE Stable-Debuginfo $basearchbaseurl= https://download.docker.com/linux/centos/7/debug-$basearch/stableenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg[docker-ce-stable-source]name=Docker CE Stable-Sourcesbaseurl= https://download.docker.com/linux/centos/7/source/stableenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg[ Docker-ce-edge] name=Docker CE Edge-$basearchbaseurl= https://download.docker.com/linux/centos/7/$basearch/edgeenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg[docker-ce-edge-debuginfo]name=Docker CE Edge-Debuginfo $basearchbaseurl= https://download.docker.com/linux/centos/7/debug-$basearch/edgeenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg[docker-ce-edge-source]name=Docker CE Edge-Sourcesbaseurl= https://download.docker.com/linux/centos/7 / source/edgeenabled=0gpgcheck=1gpgkey= https://download.docker.com/linux/centos/gpg[docker-ce-test]name=Docker CE Test-$basearchbaseurl= https://download.docker.com/linux/centos/7/$basearch/testenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg[docker-ce-test-debuginfo]name=Docker CE Test-Debuginfo $basearchbaseurl= https://download.docker.com/linux/centos/7/debug-$basearch/testenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg[docker-ce-test-source] Name=Docker CE Test-Sourcesbaseurl= https://download.docker.com/linux/centos/7/source/testenabled=0gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpg
3. Install docker:
Sudo yum install docker-ceLoaded plugins: fastestmirror LangpacksLoading mirror speeds from cached hostfileResolving Dependencies-- > Running transaction check--- > Package docker-ce.x86_64 0:17.03.1.ce-1.el7.centos will be installed-- > Processing Dependency: docker-ce-selinux > = 17.03.1.ce-1.el7.centos for package: docker-ce-17.03.1.ce-1.el7.centos.x86_64-- > Running transaction check--- > Package docker-ce-selinux.noarch 0VR 17.03.1.ce- 1.el7.centos will be installed-- > Finished Dependency ResolutionDependencies Resolved= Package Arch Version Repository Size=Installing: docker-ce x86'64 17.03.1.ce-1.el7.centos docker-ce-stable 19 MInstalling for dependencies: docker-ce-selinux noarch 17.03.1.ce-1.el7.centos docker-ce-stable 28 kTransaction Summary=Install 1 Package (+ 1 Dependent package) Total download size: 19 MInstalled size: 19 MIs this ok [y/d/N]: y
4. Download the rpm package directly to install:
1. When I installed docker, I found that the download speed was only 3kB/s, but the file size was 19m. Just when I felt that the installation was hopeless, I tactfully thought of downloading rpm directly.
I looked at docker.repo and found that the source address of centos7 is https://download.docker.com/linux/centos/7/$basearch/stable, so I just have to go.
Https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
Just download the rpm package using Xunlei (I am a member with acceleration).
Download the following files:
Docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm
Docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm
5. Install docker:
Lltotal 19096-rwxrwxrwx 1 jianglexing jianglexing 19521288 May 30 20:05 docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm-rw-r--r-- 1 jianglexing jianglexing 29108 May 30 20:15 docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm [root@workstudio docker] # yum localinstall * Loaded plugins: fastestmirror LangpacksExamining docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm: docker-ce-17.03.0.ce-1.el7.centos.x86_64Marking docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm to be installedExamining docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm: docker-ce-selinux-17.03.0.ce-1.el7.centos.noarchMarking docker-ce -selinux-17.03.0.ce-1.el7.centos.noarch.rpm to be installedResolving Dependencies-- > Running transaction check--- > Package docker-ce.x86_64 0:17.03.0.ce-1.el7.centos will be installed--- > Package docker-ce-selinux.noarch 0:17.03.0.ce-1.el7.centos will be installed-- > Finished Dependency ResolutionDependencies Resolved= Package Arch Version Repository Size=Installing: docker-ce x86_64 17.03.0.ce-1.el7.centos / docker-ce-17.03.0.ce-1.el7.centos.x86_64 65 M docker-ce-selinux noarch 17.03.0.ce-1.el7.centos / docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch 43 kTransaction Summary=Install 2 PackagesTotal size: 65 MInstalled size: 65 MIs this ok [ Y/d/N]: yDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing: docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch 1/2 setsebool: SELinux is disabled.libsemanage.semanage_direct_install_info: Overriding docker module at lower priority 100 with module at priority 400. Installing: docker-ce-17.03.0.ce-1.el7.centos.x86_64 2/2 Verifying: docker-ce-17.03.0.ce-1.el7.centos.x86_64 1/2 Verifying: docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch 2/2 Installed: docker-ce.x86_64 0:17.03.0.ce-1.el7.centos docker-ce-selinux.noarch 0:17.03.0.ce-1.el7.centos Complete!
6. Start docker:
[root@workstudio docker] # systemctl start docker [root@workstudio docker] # ps-ef | grep dockerroot 4458 1 1 20:22? 00:00:00 / usr/bin/dockerdroot 4465 4458 0 20:22? 00:00:00 docker-containerd- l unix:///var/run/docker/libcontainerd/docker-containerd.sock-metrics-interval=0-- start-timeout 2m-state-dir / var/run/docker/libcontainerd/containerd-- shim docker-containerd-shim-- runtime Docker-runcroot 4589 4333 0 20:22 pts/1 00:00:00 grep-color=auto docker
7. Test whether docker can run successfully:
[root@workstudio docker] # docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world78445dd45222: Pull complete Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7Status: Downloaded newer image for hello-world:latestHello from docking this message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $docker run-it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
The following is the first time to run the hello-world docker-image because it does not exist locally, so it may take a while to download it!
The above is all the contents of the article "how to configure the official source of docker and install docker with yum". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.