{"id":2648,"date":"2022-07-04T17:31:18","date_gmt":"2022-07-04T08:31:18","guid":{"rendered":"https:\/\/blog.wsd.sh\/?p=2648"},"modified":"2022-08-15T23:05:49","modified_gmt":"2022-08-15T14:05:49","slug":"docker-install","status":"publish","type":"post","link":"https:\/\/blog.wsd.sh\/?p=2648","title":{"rendered":"<small>centos stram 9:docker install<\/small>"},"content":{"rendered":"<p>https:\/\/docs.docker.com\/engine\/install\/centos\/<\/p>\n<p>\uff11\uff0einstall yum-utils<br \/>\nhttps:\/\/docs.docker.com\/engine\/install\/centos\/<\/p>\n<pre>\r\n# yum install -y yum-utils\r\n\r\n\uff12\uff0einstall yum-config-manager\r\n# yum-config-manager \\\r\n    --add-repo \\\r\n    https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\r\n<\/pre>\n<p>\uff13\uff0einstall docker-ce <\/p>\n<pre>\r\n# yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin --skip-broken\r\nLast metadata expiration check: 0:00:43 ago on Mon 04 Jul 2022 05:02:51 PM JST.\r\nDependencies resolved.\r\n==================================================================================\r\n Package                  Arch      Version             Repository           Size\r\n==================================================================================\r\nInstalling:\r\n docker-ce-cli            x86_64    1:20.10.17-3.el9    docker-ce-stable     29 M\r\n docker-compose-plugin    x86_64    2.6.0-3.el9         docker-ce-stable    6.9 M\r\nInstalling weak dependencies:\r\n docker-scan-plugin       x86_64    0.17.0-3.el9        docker-ce-stable    3.6 M\r\n\r\nTransaction Summary\r\n==================================================================================\r\nInstall  3 Packages\r\n\r\nTotal download size: 40 M\r\nInstalled size: 178 M\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/3): docker-scan-plugin-0.17.0-3.el9.x86_64.rpm 6.9 MB\/s | 3.6 MB     00:00\r\n(2\/3): docker-compose-plugin-2.6.0-3.el9.x86_64.r  11 MB\/s | 6.9 MB     00:00\r\n(3\/3): docker-ce-cli-20.10.17-3.el9.x86_64.rpm     24 MB\/s |  29 MB     00:01\r\n----------------------------------------------------------------------------------\r\nTotal                                              33 MB\/s |  40 MB     00:01\r\nDocker CE Stable - x86_64                          11 kB\/s | 1.6 kB     00:00\r\nImporting GPG key 0x621E9F35:\r\n Userid     : \"Docker Release (CE rpm) <docker@docker.com>\"\r\n Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35\r\n From       : https:\/\/download.docker.com\/linux\/centos\/gpg\r\nIs this ok [y\/N]:y\r\nKey imported successfully\r\nRunning transaction check\r\nTransaction check succeeded.\r\nRunning transaction test\r\nTransaction test succeeded.\r\nRunning transaction\r\n  Preparing        :                                                          1\/1\r\n  Installing       : docker-scan-plugin-0.17.0-3.el9.x86_64                   1\/3\r\n  Running scriptlet: docker-scan-plugin-0.17.0-3.el9.x86_64                   1\/3\r\n  Installing       : docker-ce-cli-1:20.10.17-3.el9.x86_64                    2\/3\r\n  Running scriptlet: docker-ce-cli-1:20.10.17-3.el9.x86_64                    2\/3\r\n  Installing       : docker-compose-plugin-2.6.0-3.el9.x86_64                 3\/3\r\n  Running scriptlet: docker-compose-plugin-2.6.0-3.el9.x86_64                 3\/3\r\n  Verifying        : docker-ce-cli-1:20.10.17-3.el9.x86_64                    1\/3\r\n  Verifying        : docker-compose-plugin-2.6.0-3.el9.x86_64                 2\/3\r\n  Verifying        : docker-scan-plugin-0.17.0-3.el9.x86_64                   3\/3\r\n\r\nInstalled:\r\n  docker-ce-cli-1:20.10.17-3.el9.x86_64  docker-compose-plugin-2.6.0-3.el9.x86_64\r\n  docker-scan-plugin-0.17.0-3.el9.x86_64\r\nSkipped:\r\n  buildah-1.24.0-0.15.el9.x86_64      buildah-1:1.24.1-1.el9.x86_64\r\n  buildah-1:1.25.1-1.el9.x86_64       buildah-1:1.26.1-3.el9.x86_64\r\n  containerd.io-1.6.6-3.1.el9.x86_64  runc-2:1.0.0-332.dev.gitbd013b6.el9.x86_64\r\n  runc-3:1.1.0-2.el9.x86_64           runc-4:1.0.3-4.el9.x86_64\r\n  runc-4:1.0.3-5.el9.x86_64\r\n\r\nComplete!\r\n#\r\n<\/pre>\n<p>\uff14\uff0edocker-ce install<\/p>\n<pre>\r\n[root@localhost document]# yum install docker-ce-20.10.17-3.el9 docker-ce-cli-20.10.17-3.el9 containerd.io docker-compose-plugin --allowerasing\r\nLast metadata expiration check: 0:08:19 ago on Mon 04 Jul 2022 05:02:51 PM JST.\r\nPackage docker-ce-cli-1:20.10.17-3.el9.x86_64 is already installed.\r\nPackage docker-compose-plugin-2.6.0-3.el9.x86_64 is already installed.\r\nDependencies resolved.\r\n==================================================================================\r\n Package                     Arch     Version            Repository          Size\r\n==================================================================================\r\nInstalling:\r\n containerd.io               x86_64   1.6.6-3.1.el9      docker-ce-stable    32 M\r\n     replacing  runc.x86_64 4:1.1.2-1.el9\r\n docker-ce                   x86_64   3:20.10.17-3.el9   docker-ce-stable    21 M\r\nInstalling dependencies:\r\n docker-ce-rootless-extras   x86_64   20.10.17-3.el9     docker-ce-stable   3.8 M\r\nRemoving dependent packages:\r\n buildah                     x86_64   1:1.26.1-4.el9     @appstream          29 M\r\n\r\nTransaction Summary\r\n==================================================================================\r\nInstall  3 Packages\r\nRemove   1 Package\r\n\r\nTotal download size: 58 M\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/3): docker-ce-rootless-extras-20.10.17-3.el9.x 9.0 MB\/s | 3.8 MB     00:00\r\n(2\/3): docker-ce-20.10.17-3.el9.x86_64.rpm         19 MB\/s |  21 MB     00:01\r\n(3\/3): containerd.io-1.6.6-3.1.el9.x86_64.rpm      23 MB\/s |  32 MB     00:01\r\n----------------------------------------------------------------------------------\r\nTotal                                              40 MB\/s |  58 MB     00:01\r\nRunning transaction check\r\nTransaction check succeeded.\r\nRunning transaction test\r\nTransaction test succeeded.\r\nRunning transaction\r\n  Preparing        :                                                          1\/1\r\n  Installing       : containerd.io-1.6.6-3.1.el9.x86_64                       1\/5\r\n  Running scriptlet: containerd.io-1.6.6-3.1.el9.x86_64                       1\/5\r\n  Installing       : docker-ce-rootless-extras-20.10.17-3.el9.x86_64          2\/5\r\n  Running scriptlet: docker-ce-rootless-extras-20.10.17-3.el9.x86_64          2\/5\r\n  Installing       : docker-ce-3:20.10.17-3.el9.x86_64                        3\/5\r\n  Running scriptlet: docker-ce-3:20.10.17-3.el9.x86_64                        3\/5\r\n  Erasing          : buildah-1:1.26.1-4.el9.x86_64                            4\/5\r\n  Obsoleting       : runc-4:1.1.2-1.el9.x86_64                                5\/5\r\n  Running scriptlet: runc-4:1.1.2-1.el9.x86_64                                5\/5\r\n  Verifying        : containerd.io-1.6.6-3.1.el9.x86_64                       1\/5\r\n  Verifying        : runc-4:1.1.2-1.el9.x86_64                                2\/5\r\n  Verifying        : docker-ce-3:20.10.17-3.el9.x86_64                        3\/5\r\n  Verifying        : docker-ce-rootless-extras-20.10.17-3.el9.x86_64          4\/5\r\n  Verifying        : buildah-1:1.26.1-4.el9.x86_64                            5\/5\r\n\r\nInstalled:\r\n  containerd.io-1.6.6-3.1.el9.x86_64\r\n  docker-ce-3:20.10.17-3.el9.x86_64\r\n  docker-ce-rootless-extras-20.10.17-3.el9.x86_64\r\nRemoved:\r\n  buildah-1:1.26.1-4.el9.x86_64\r\n\r\nComplete!\r\n<\/pre>\n<p>\uff15\uff0edocker\u306edeamon \u8d77\u52d5<\/p>\n<pre>\r\n#  systemctl start docker\r\n<\/pre>\n<pre>\r\n[root@localhost document]# docker run hello-world\r\nUnable to find image 'hello-world:latest' locally\r\nlatest: Pulling from library\/hello-world\r\n2db29710123e: Pull complete\r\nDigest: sha256:13e367d31ae85359f42d637adf6da428f76d75dc9afeb3c21faea0d976f5c651\r\nStatus: Downloaded newer image for hello-world:latest\r\n\r\nHello from Docker!\r\nThis message shows that your installation appears to be working correctly.\r\n\r\nTo generate this message, Docker took the following steps:\r\n 1. The Docker client contacted the Docker daemon.\r\n 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\r\n    (amd64)\r\n 3. The Docker daemon created a new container from that image which runs the\r\n    executable that produces the output you are currently reading.\r\n 4. The Docker daemon streamed that output to the Docker client, which sent it\r\n    to your terminal.\r\n\r\nTo try something more ambitious, you can run an Ubuntu container with:\r\n $ docker run -it ubuntu bash\r\n\r\nShare images, automate workflows, and more with a free Docker ID:\r\n https:\/\/hub.docker.com\/\r\n\r\nFor more examples and ideas, visit:\r\n https:\/\/docs.docker.com\/get-started\/\r\n\r\n#\r\n<\/pre>\n<p>\uff16\uff0edocker\u306einstatnce\u8d77\u52d5<\/p>\n<pre>\r\n# docker run -it ubuntu bash\r\nUnable to find image 'ubuntu:latest' locally\r\nlatest: Pulling from library\/ubuntu\r\n405f018f9d1d: Pull complete\r\nDigest: sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac\r\nStatus: Downloaded newer image for ubuntu:latest\r\nroot@bf90fe541fac:\/#\r\n<\/pre>\n<pre>\r\n# docker PS\r\nCONTAINER ID   IMAGE     COMMAND   CREATED          STATUS          PORTS     NAMES\r\nbf90fe541fac   ubuntu    \"bash\"    14 minutes ago   Up 14 minutes             focused_robinson\r\n# docker inspect bf90fe541fac |grep IPAddress\r\n            \"SecondaryIPAddresses\": null,\r\n            \"IPAddress\": \"172.17.0.2\",\r\n                    \"IPAddress\": \"172.17.0.2\",\r\n#\r\n<\/pre>\n<p>\uff17\uff0e<\/p>\n<pre>\r\n# curl -fsSL https:\/\/get.docker.com -o get-docker.sh\r\n# DRY_RUN=1 sh .\/get-docker.sh\r\n# Executing docker install script, commit: b2e29ef7a9a89840d2333637f7d1900a83e7153f\r\nWarning: the \"docker\" command appears to already exist on this system.\r\n\r\nIf you already have Docker installed, this script can cause trouble, which is\r\nwhy we're displaying this warning and provide the opportunity to cancel the\r\ninstallation.\r\n\r\nIf you installed the current Docker package using this script and are using it\r\nagain to update Docker, you can safely ignore this message.\r\n\r\nYou may press Ctrl+C now to abort this script.\r\n+ sleep 20\r\nyum install -y -q yum-utils\r\nyum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\r\nyum makecache\r\nyum install -y -q docker-ce docker-ce-cli containerd.io docker-scan-plugin docker-compose-plugin docker-ce-rootless-extras\r\n# yum install -y -q yum-utils\r\n# yum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\r\nAdding repo from: https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\r\n# yum makecache\r\nCentOS Stream 9 - BaseOS                          2.8 kB\/s | 5.0 kB     00:01\r\nCentOS Stream 9 - AppStream                        23 kB\/s | 5.0 kB     00:00\r\nCentOS Stream 9 - CRB                              15 kB\/s | 4.9 kB     00:00\r\nCentOS Stream 9 - Extras packages                 5.9 kB\/s | 5.4 kB     00:00\r\nDocker CE Stable - x86_64                          27 kB\/s | 3.5 kB     00:00\r\nExtra Packages for Enterprise Linux 9 - x86_64     20 kB\/s | 6.7 kB     00:00\r\nExtra Packages for Enterprise Linux 9 - Next - x8  38 kB\/s |  10 kB     00:00\r\nRemi's Modular repository for Enterprise Linux 9  508  B\/s | 833  B     00:01\r\nSafe Remi's RPM repository for Enterprise Linux 9 527  B\/s | 833  B     00:01\r\nMetadata cache created.\r\n# yum install -y -q docker-ce docker-ce-cli containerd.io docker-scan-plugin docker-compose-plugin docker-ce-rootless-extras\r\n#\r\n<\/pre>\n<p>8. new login<br \/>\n-\u3000user07<\/p>\n<pre>\r\n$ pwd\r\n\/home\/user07\r\n$ sudo docker run -it ubuntu bash\r\nroot@bcb8ac524ec6:\/# uname -a\r\nLinux bcb8ac524ec6 5.14.0-142.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 4 18:15:17 UTC 2022 x86_64 x86_64 x86_64 GNU\/Linux\r\nroot@bcb8ac524ec6:\/# ps\r\n    PID TTY          TIME CMD\r\n      1 pts\/0    00:00:00 bash\r\n     10 pts\/0    00:00:00 ps\r\nroot@bcb8ac524ec6:\/# pwd\r\n<\/pre>\n<p>9. IPAddress<\/p>\n<pre>\r\n# docker inspect bcb8ac524ec6 |grep IPAddress\r\n            \"SecondaryIPAddresses\": null,\r\n            \"IPAddress\": \"172.17.0.2\",\r\n                    \"IPAddress\": \"172.17.0.2\",\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/docs.docker.com\/engine\/install\/centos\/ \uff11\uff0einstall yum-utils https:\/\/docs.docker.com\/engine\/install\/cent&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2648"}],"collection":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2648"}],"version-history":[{"count":12,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2648\/revisions"}],"predecessor-version":[{"id":3171,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2648\/revisions\/3171"}],"wp:attachment":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}