{"id":1843,"date":"2025-06-07T18:48:29","date_gmt":"2025-06-07T10:48:29","guid":{"rendered":"http:\/\/113.45.254.23\/?p=1843"},"modified":"2025-07-03T11:29:16","modified_gmt":"2025-07-03T03:29:16","slug":"docker%e7%9a%84%e6%97%a5%e5%b8%b8%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"http:\/\/113.45.254.23\/?p=1843","title":{"rendered":"\u5b89\u88c5docker\uff0cdocker\u7684\u65e5\u5e38\u4f7f\u7528"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u5b9e\u9a8c\u73af\u5883\uff1a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Rocky12\u3001Rocky11\u8fd8\u539f\u81f3\u65b0\u7cfb\u7edf\uff0c\u5f00\u673a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u5b89\u88c5docker<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2&nbsp;&nbsp;\u5b89\u88c5dockers\u7684\u63d2\u4ef6\n\nRocky Linux 9 - BaseOS &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;357 kB\/s | 2.3 MB &nbsp;&nbsp;&nbsp;&nbsp;00:06 &nbsp;&nbsp;&nbsp;\n\nRocky Linux 9 - AppStream &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;406 kB\/s | 8.4 MB &nbsp;&nbsp;&nbsp;&nbsp;00:21 &nbsp;&nbsp;&nbsp;\n\nRocky Linux 9 - Extras &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.2 kB\/s | &nbsp;16 kB &nbsp;&nbsp;&nbsp;&nbsp;00:02 &nbsp;&nbsp;&nbsp;\n\nPackage device-mapper-persistent-data-1.0.9-3.el9_4.x86_64 is already installed.\n\nPackage lvm2-9:2.03.24-2.el9.x86_64 is already installed.\n\nDependencies resolved.\n\n==========================================================================================================\n\n&nbsp;Package &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Architecture &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Version &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Repository &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Size\n\n==========================================================================================================\n\nInstalling:\n\n&nbsp;yum-utils &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;noarch &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.3.0-16.el9 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;baseos &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;35 k\n\nTransaction Summary\n\n==========================================================================================================\n\nInstall &nbsp;1 Package\n\nTotal download size: 35 k\n\nInstalled size: 23 k\n\nDownloading Packages:\n\nyum-utils-4.3.0-16.el9.noarch.rpm &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;83 kB\/s | &nbsp;35 kB &nbsp;&nbsp;&nbsp;&nbsp;00:00 &nbsp;&nbsp;&nbsp;\n\n----------------------------------------------------------------------------------------------------------\n\nTotal &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;28 kB\/s | &nbsp;35 kB &nbsp;&nbsp;&nbsp;&nbsp;00:01 &nbsp;&nbsp;&nbsp;&nbsp;\n\nRocky Linux 9 - BaseOS &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.7 MB\/s | 1.7 kB &nbsp;&nbsp;&nbsp;&nbsp;00:00 &nbsp;&nbsp;&nbsp;\n\nImporting GPG key 0x350D275D:\n\n&nbsp;Userid &nbsp;&nbsp;&nbsp;&nbsp;: \"Rocky Enterprise Software Foundation - Release key 2022 &lt;releng@rockylinux.org&gt;\"\n\n&nbsp;Fingerprint: 21CB 256A E16F C54C 6E65 2949 702D 426D 350D 275D\n\n&nbsp;From &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-Rocky-9\n\nKey imported successfully\n\nRunning transaction check\n\nTransaction check succeeded.\n\nRunning transaction test\n\nTransaction test succeeded.\n\nRunning transaction\n\n&nbsp;&nbsp;Preparing &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1\/1\n\n&nbsp;&nbsp;Installing &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: yum-utils-4.3.0-16.el9.noarch &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1\/1\n\n&nbsp;&nbsp;Running scriptlet: yum-utils-4.3.0-16.el9.noarch &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1\/1\n\n&nbsp;&nbsp;Verifying &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: yum-utils-4.3.0-16.el9.noarch &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1\/1\n\nInstalled:\n\n&nbsp;&nbsp;yum-utils-4.3.0-16.el9.noarch &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\nComplete!<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# yum config-manager --add-repo=https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo \u4e0b\u8f7ddocker\u7684\u6570\u636e\u6e90\nAdding repo from: https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo\n&#91;root@Server12 ~]# \n&#91;root@Server12 ~]# dnf -y install docker-ce  \u5b89\u88c5docker\u793e\u533a\u7248\nDocker CE Stable - x86_64                                                  15 kB\/s |  73 kB     00:04    \nLast metadata expiration check: 0:00:02 ago on Wed 04 Jun 2025 02:24:31 PM CST.\nDependencies resolved.<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# systemctl enable --now docker  \u542f\u52a8docker\u5e76\u8bbe\u7f6edockers\u5f00\u673a\u542f\u52a8\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/docker.service \u2192 \/usr\/lib\/systemd\/system\/docker.service.\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# vim \/etc\/docker\/daemon.json  \u521b\u5efadocker\u955c\u50cf\u52a0\u901f\u5668\n&#91;root@Server12 ~]# \n{\n    \"registry-mirrors\":&#91;\n        \"https:\/\/mirror.baidubce.com\",\n        \"https:\/\/9cpn8tt6.mirror.aliyuncs.com\",\n        \"https:\/\/registry.docker-cn.com\",\n        \"https:\/\/dockerproxy.com\",\n        \"https:\/\/mirror.baidubce.com\",\n        \"https:\/\/docker.m.daocloud.io\",\n        \"https:\/\/docker.nju.edu.cn\",\n        \"https:\/\/docker.1panel.live\",\n        \"https:\/\/hub.rat.dev\",\n        \"https:\/\/mirror-gcr.onrender.com\",\n        \"https:\/\/docker.mirrors.sjtug.sjtu.edu.cn\",\n        \"https:\/\/docker.mirrors.ustc.edu.cn\",\n        \"https:\/\/reg-mirror.qiniu.com\",\n        \"https:\/\/registry.docker-cn.com\"\n    ]\n}\n&#91;root@Server12 ~]# systemctl restart docker\t  \u91cd\u542fdocker\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001<strong>\u62c9\u53d6\u955c\u50cf\uff1a<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker pull nginx:1.26.0  docker\u62c9\u53d6nginx:1.26.0\u7684\u955c\u50cf\n1.26.0: Pulling from library\/nginx\n09f376ebb190: Pull complete \n78240426b67a: Pull complete \nc08c0ae256e2: Pull complete \n10463a6831a8: Pull complete \nbd444d50f7de: Pull complete \n8785af845a38: Pull complete \n694e3980a1e1: Pull complete \nDigest: sha256:192e88a0053c178683ca139b9d9a2afb0ad986d171fae491949fe10970dd9da9\nStatus: Downloaded newer image for nginx:1.26.0\ndocker.io\/library\/nginx:1.26.0\n&#91;root@Server12 ~]# docker images\t\t\u67e5\u770bdockers\u955c\u50cf\nREPOSITORY   TAG       IMAGE ID       CREATED         SIZE\nnginx        1.26.0    94543a6c1aef   13 months ago   188MB\n&#91;root@Server12 ~]# \n&#91;root@Server12 ~]# shutdown -h now\nConnection closing...Socket close.\n\nConnection closed by foreign host.\n\nDisconnected from remote host(192.168.7.12) at 14:44:26.\n\nType `help' to learn how to use Xshell prompt.\n&#91;C:\\~]$ <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u62cd\u6444\u5feb\u7167\uff1a<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/113.45.254.23\/wp-content\/uploads\/2025\/06\/image-13.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"281\" data-original=\"http:\/\/113.45.254.23\/wp-content\/uploads\/2025\/06\/image-13.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1844\"  sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u62c9\u53d6rockylinux\u3001ubuntu\u955c\u50cf<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker pull rockylinux:9.2  dockers\u62c9\u53d6rockylinux:9.2\u7684\u955c\u50cf\n9.2: Pulling from library\/rockylinux\n1a5eb4db1701: Pull complete \nDigest: sha256:b07e21a7bbcecbae55b9153317d333d4d50808bf5dc0859db0180b6fbd7afb3d\nStatus: Downloaded newer image for rockylinux:9.2\ndocker.io\/library\/rockylinux:9.2\n&#91;root@Server12 ~]# docker pull ubuntu  docker\u62c9\u53d6ubuntu\u7684\u955c\u50cf\nUsing default tag: latest<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker images  \u67e5\u770bdockers\u955c\u50cf\nREPOSITORY   TAG       IMAGE ID       CREATED         SIZE\nubuntu       latest    bf16bdcff9c9   6 days ago      78.1MB\nnginx        1.26.0    94543a6c1aef   13 months ago   188MB\nrockylinux   9.2       eeea865f4111   2 years ago     176MB\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001<strong>\u8fd0\u884c\u955c\u50cf\u3001\u751f\u6210\u5bb9\u5668<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker run -it rockylinux:9.2 bash  \ndocker\u8fd0\u884crockylinux:9.2\u7684\u955c\u50cf\u751f\u6210\u5bb9\u5668\uff0c\u5e76\u8fdb\u5165\u5bb9\u5668\u91cc\nit \u4ee5\u4ea4\u4e92\u6a21\u5f0f\u8fdb\u5165\u5bb9\u5668\uff0c\u5e76\u6253\u5f00\u7ec8\u7aef\uff0c-i \u8ba9\u5bb9\u5668\u7684\u8f93\u5165\u4fdd\u6301\u6253\u5f00\uff0c-t\u8ba9\u5bb9\u5668\u5206\u914d\u4e00\u4e2a\u4f2a\u7ec8\u7aef\n&#91;root@e59afb4cf5d1 \/]# uname -r  \u67e5\u770b\u7cfb\u7edf\u5185\u6838\n5.14.0-503.14.1.el9_5.x86_64\n&#91;root@e59afb4cf5d1 \/]# cat \/etc\/redhat-release \t \u67e5\u770b\u7cfb\u7edf\u7248\u672c\nRocky Linux release 9.2 (Blue Onyx)   \u771f\u5b9e\u673a\u5185\u6838\n&#91;root@e59afb4cf5d1 \/]# \n&#91;root@e59afb4cf5d1 \/]# exit   \t\t\u9000\u51fa\u5bb9\u5668\uff0c\u505c\u6b62\u8fd0\u884c\nexit\n&#91;root@Server12 ~]# \n&#91;root@Server12 ~]# docker ps\t\t\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\uff08\u65e0\uff09\nCONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES\n&#91;root@Server12 ~]# docker ps -a\t\t\u67e5\u770b\u6240\u6709\u5bb9\u5668\uff08\u8fd0\u884c\u7684\u548c\u505c\u6b62\u7684\uff09\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS                     PORTS     NAMES\ne59afb4cf5d1   rockylinux:9.2   \"bash\"    52 seconds ago   Exited \u505c\u6b62\u7684(0) 8 seconds ago             boring_jennings\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker run -it ubuntu bash  \u8fd0\u884cUbuntu\u7684\u955c\u50cf\uff0c\u751f\u6210Ubuntu\u7684\u5bb9\u5668\uff0c\u5e76\u8fdb\u5165\u5bb9\u5668\u91cc\nroot@f9f75b7ef6e9:\/# uname -r    \u67e5\u770b\u5185\u6838\n5.14.0-503.14.1.el9_5.x86_64      \u771f\u5b9e\u673a\u7684\u5185\u6838\nroot@f9f75b7ef6e9:\/# cat \/etc\/os-release   \u67e5\u770b\u7cfb\u7edf\u7248\u672c\nPRETTY_NAME=\"Ubuntu 24.04.2 LTS\"       Ubuntu \u7248\u672c24.04.2\nNAME=\"Ubuntu\"\nVERSION_ID=\"24.04\"\nVERSION=\"24.04.2 LTS (Noble Numbat)\"\nVERSION_CODENAME=noble\nID=ubuntu\nID_LIKE=debian\nHOME_URL=\"https:\/\/www.ubuntu.com\/\"\nSUPPORT_URL=\"https:\/\/help.ubuntu.com\/\"\nBUG_REPORT_URL=\"https:\/\/bugs.launchpad.net\/ubuntu\/\"\nPRIVACY_POLICY_URL=\"https:\/\/www.ubuntu.com\/legal\/terms-and-policies\/privacy-policy\"\nUBUNTU_CODENAME=noble\nLOGO=ubuntu-logo\nroot@f9f75b7ef6e9:\/# &#91;root@Server12 ~]#   \u53e6\u4e00\u79cd\u9000\u51fa\u5bb9\u5668\u7684\u65b9\u6cd5\uff1actrl+p+q;\u9000\u51fa\u5bb9\u5668\uff0c\u5bb9\u5668\u4ecd\u5728\u8fd0\u884c\nCONTAINER ID   IMAGE     COMMAND   CREATED         STATUS         PORTS     NAMES\nf9f75b7ef6e9   ubuntu    \"bash\"    2 minutes ago   Up 2 minutes             eloquent_franklin\n&#91;root@Server12 ~]# docker ps    \u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker ps -a   \u67e5\u770b\u6240\u6709\u5bb9\u5668\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS                      PORTS     NAMES\nf9f75b7ef6e9   ubuntu           \"bash\"    8 minutes ago    Up 8 minutes                          eloquent_franklin\ne59afb4cf5d1   rockylinux:9.2   \"bash\"    12 minutes ago   Exited (0) 11 minutes ago             boring_jennings\n&#91;root@Server12 ~]# docker start e59afb4cf5d1   docker\u542f\u52a8rocky9.4\u7684\u5bb9\u5668\uff1be59afb4cf5d1\u5bb9\u5668\u7684ID\u53f7\ne59afb4cf5d1\n&#91;root@Server12 ~]# docker ps \u67e5\u770b\u6240\u6709\u5bb9\u5668\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS          PORTS     NAMES\nf9f75b7ef6e9   ubuntu           \"bash\"    9 minutes ago    Up  \u6d3b\u52a8\u7684  9 minutes              eloquent_franklin\ne59afb4cf5d1   rockylinux:9.2   \"bash\"    12 minutes ago   Up\u6d3b\u52a8\u7684  10 seconds             boring_jennings\n&#91;root@Server12 ~]# docker stop f9f75b7ef6e9   docker \u5173\u95edUbuntu\u7684\u5bb9\u5668\uff08ubuntu \u5bb9\u5668\u7684ID\uff1a f9f75b7ef6e9\uff09\nf9f75b7ef6e9\n&#91;root@Server12 ~]# docker ps  Ubuntu\u5bb9\u5668\u6ca1\u4e86\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS          PORTS     NAMES\ne59afb4cf5d1   rockylinux:9.2   \"bash\"    13 minutes ago   Up\u6d3b\u52a8\u7684  55 seconds             boring_jennings\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001<strong>\u5220\u9664\u955c\u50cf\uff0c\u5220\u9664\u5bb9\u5668<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker rmi nginx:1.26.0\t\t\u5220\u9664nginx:1.26.0\u955c\u50cf\uff0c\uff08rm\u5220\u9664\u5bb9\u5668\uff09\nUntagged: nginx:1.26.0\nUntagged: nginx@sha256:192e88a0053c178683ca139b9d9a2afb0ad986d171fae491949fe10970dd9da9\nDeleted: sha256:94543a6c1aefa9dfe9b4686d815a0b4470663c2d5f9abfdc2dcf9ef03b59149a\nDeleted: sha256:e9eff30b6a9a33eb26e2a65e1ada5e32fd82d8fea650e4aa12f861da6b8f0d7f\nDeleted: sha256:7e68efa1498b7ad724cdb01922b8e91ea66717a2c00d04d621bd727778d31196\nDeleted: sha256:f0840fe5287af0eb3fb8ca8b2693dfaedc92e29772604f1f32800297555a5637\nDeleted: sha256:2c9a63f662ed1d10d5ad54ba720e1dbfa4a2b09d6f0a9ad9cbfa7e701bad25b1\nDeleted: sha256:a25abc4196a82a70072dd67d08f8b2adc09ea71a63188ce0ffb8d5aae7133ea9\nDeleted: sha256:09fbfd28794602bc5859e2481e898fe575169ce03eae4244fd9a26628f1060c2\nDeleted: sha256:5d4427064ecc46e3c2add169e9b5eafc7ed2be7861081ec925938ab628ac0e25\n&#91;root@Server12 ~]# docker images\t\t\tnginx\u955c\u50cf\u6ca1\u4e86\nREPOSITORY   TAG       IMAGE ID       CREATED       SIZE\nubuntu       latest    bf16bdcff9c9   6 days ago    78.1MB\nrockylinux   9.2       eeea865f4111   2 years ago   176MB\n&#91;root@Server12 ~]# docker ps -a\t\t\t\t\u67e5\u770b\u6240\u6709\u5bb9\u5668\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS                        PORTS     NAMES\nf9f75b7ef6e9   ubuntu           \"bash\"    43 minutes ago   Exited (137) \u505c\u6b62\u768433 minutes ago             eloquent_franklin\ne59afb4cf5d1   rockylinux:9.2   \"bash\"    46 minutes ago   Up 34 minutes                           boring_jennings\n&#91;root@server12 ~]# docker ps -a \u67e5\u770b\u6240\u6709\u5bb9\u5668\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS                        PORTS     NAMES\n5d80f3d979e6   ubuntu           \"bash\"    40 minutes ago   Exited (137) 30 minutes ago             eager_engelbart\n3a19cc74837c   rockylinux:9.2   \"bash\"    43 minutes ago   Up 31 minutes                           focused_heyrovsky\n&#91;root@server12 ~]# \n&#91;root@server12 ~]# docker rm 3a19cc74837c \u5220\u9664rockylinux:9.2\u5bb9\u5668\nError response from daemon: cannot remove container \"3a19cc74837c\": container is running: stop the container before removing or force remove\n\u5bb9\u5668\u6b63\u5728\u8fd0\u884c\u65f6\uff0c\u5220\u4e0d\u6389\n\n&#91;root@server12 ~]# docker stop 3a19cc74837c\t\u5173\u95edrockylinux:9.2\u7684\u5bb9\u5668\n3a19cc74837c\n&#91;root@server12 ~]# docker ps -a\t\u67e5\u770b\u8fd0\u884c\u7684\u6240\u6709\u5bb9\u5668\nCONTAINER ID   IMAGE            COMMAND   CREATED          STATUS                        PORTS     NAMES\n5d80f3d979e6   ubuntu           \"bash\"    41 minutes ago   Exited (137) 31 minutes ago             eager_engelbart\n3a19cc74837c   rockylinux:9.2   \"bash\"    44 minutes ago   Exited (137) 10 seconds ago             focused_heyrovsky\n\n\n&#91;root@server12 ~]# docker rm 3a19cc74837c\t\u5220\u9664rockylinux:9.2\u7684\u5bb9\u5668\n3a19cc74837c\n&#91;root@server12 ~]# \n&#91;root@server12 ~]# docker ps -a \u67e5\u770b\u6240\u6709\u5bb9\u5668\uff0crockylinux:9.2\u7684\u5bb9\u5668\u6ca1\u4e86\nCONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                        PORTS     NAMES\n5d80f3d979e6   ubuntu    \"bash\"    42 minutes ago   Exited (137) 32 minutes ago             eager_engelbart<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker start f9f75b7ef6e9 \u542f\u52a8Ubuntu\u7684\u5bb9\u5668\nf9f75b7ef6e9\n&#91;root@Server12 ~]# docker ps\t\t\t\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\nCONTAINER ID   IMAGE     COMMAND   CREATED          STATUS         PORTS     NAMES\nf9f75b7ef6e9   ubuntu    \"bash\"    50 minutes ago   Up 4 seconds             eloquent_franklin\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# docker exec -it f9f75b7ef6e9 bash \u8fdb\u5165Ubuntu\u7684\u5bb9\u5668\u91cc \nroot@f9f75b7ef6e9:\/# cat \/etc\/os-release\nPRETTY_NAME=\"Ubuntu 24.04.2 LTS\"\nNAME=\"Ubuntu\"\nVERSION_ID=\"24.04\"\nVERSION=\"24.04.2 LTS (Noble Numbat)\"\nVERSION_CODENAME=noble\nID=ubuntu\nID_LIKE=debian\nHOME_URL=\"https:\/\/www.ubuntu.com\/\"\nSUPPORT_URL=\"https:\/\/help.ubuntu.com\/\"\nBUG_REPORT_URL=\"https:\/\/bugs.launchpad.net\/ubuntu\/\"\nPRIVACY_POLICY_URL=\"https:\/\/www.ubuntu.com\/legal\/terms-and-policies\/privacy-policy\"\nUBUNTU_CODENAME=noble\nLOGO=ubuntu-logo\nroot@f9f75b7ef6e9:\/# read escape sequence  \u9000\u51fa\u5bb9\u5668ctrl+p+q\n&#91;root@Server12 ~]# docker images\nREPOSITORY   TAG       IMAGE ID       CREATED       SIZE\nubuntu       latest    bf16bdcff9c9   6 days ago    78.1MB\nrockylinux   9.2       eeea865f4111   2 years ago   176MB\n&#91;root@Server12 ~]# docker save -o rockylinux9.2.tar\ndocker: 'docker save' requires at least 1 argument\n\nUsage:  docker save &#91;OPTIONS] IMAGE &#91;IMAGE...]\n\nSee 'docker save --help' for more information\n&#91;root@Server12 ~]# docker save -o rockylinux9.2.tar rockylinux:9.2 \u5c06rockylinux\u7684\u955c\u50cf\u4fdd\u5b58\u5230\u5f53\u524d\n&#91;root@Server12 ~]# \n&#91;root@Server12 ~]# ls\nanaconda-ks.cfg  rockylinux9.2.tar\n&#91;root@Server12 ~]# docker save -o ubuntu24.04.tar ubuntu:latest \u5c06ubuntu\u7684\u955c\u50cf\u4fdd\u5b58\u5230\u5f53\u524d\u76ee\u5f55\u4e0b\n&#91;root@Server12 ~]# ls\nanaconda-ks.cfg  rockylinux9.2.tar  ubuntu24.04.tar\n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@server11 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2\n&#91;root@server11 ~]# yum config-manager --add-repo=https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo\nAdding repo from: https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo\n&#91;root@server11 ~]# dnf -y install docker-ce\nDocker CE Stable - x86_64                                                 183 kB\/s |  73 kB     00:00    \nDependencies resolved.\n&#91;root@server11 ~]# systemctl enable --now docker\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/docker.service \u2192 \/usr\/lib\/systemd\/system\/docker.service.\n&#91;root@server11 ~]# vim \/etc\/docker\/daemon.json\n&#91;root@server11 ~]# systemctl restart docker\n&#91;root@server11 ~]# docker pull nginx:1.26.0\n1.26.0: Pulling from library\/nginx\n09f376ebb190: Pull complete \n78240426b67a: Pull complete \nc08c0ae256e2: Pull complete \n10463a6831a8: Pull complete \nbd444d50f7de: Pull complete \n8785af845a38: Pull complete \n694e3980a1e1: Pull complete \nDigest: sha256:192e88a0053c178683ca139b9d9a2afb0ad986d171fae491949fe10970dd9da9\nStatus: Downloaded newer image for nginx:1.26.0\ndocker.io\/library\/nginx:1.26.0\n&#91;root@server11 ~]# \n&#91;root@server11 ~]# docker images\nREPOSITORY   TAG       IMAGE ID       CREATED         SIZE\nnginx        1.26.0    94543a6c1aef   13 months ago   188MB\n&#91;root@server11 ~]# shutdown -h now\nConnection closing...Socket close.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001Rocky11\u5b89\u88c5docker\uff0c\u914d\u7f6e\u5e76\u62cd\u6444docker\u5feb\u7167<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/113.45.254.23\/wp-content\/uploads\/2025\/06\/image-14.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"274\" data-original=\"http:\/\/113.45.254.23\/wp-content\/uploads\/2025\/06\/image-14.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1845\"  sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001\u67e5\u770b\u955c\u50cf\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@Server12 ~]# \n&#91;root@Server12 ~]# ls\nanaconda-ks.cfg  rockylinux9.2.tar  ubuntu24.04.tar\n&#91;root@Server12 ~]# scp rockylinux9.2.tar 192.168.7.10:\/root\nssh: connect to host 192.168.7.10 port 22: No route to host\nConnection closed\n&#91;root@Server12 ~]# scp rockylinux9.2.tar 192.168.7.11:\/root \n\u5c06rockylinux9.2\u7684\u955c\u50cf\u538b\u7f29\u6587\u4ef6\u6587\u4ef6\uff0c\u8fdc\u7a0b\u590d\u5236\u5230192.168.7.10\u7684root\u76ee\u5f55\u4e0b\nThe authenticity of host '192.168.7.11 (192.168.7.11)' can't be established.\nED25519 key fingerprint is SHA256:xUDA0O+t2CzJjkoXTnPz4uWZHLsBka7X2jWeyssMSNo.\nThis key is not known by any other names\nAre you sure you want to continue connecting (yes\/no\/&#91;fingerprint])? yes\nWarning: Permanently added '192.168.7.11' (ED25519) to the list of known hosts.\nroot@192.168.7.11's password: \nrockylinux9.2.tar                                                       100%  173MB  92.7MB\/s   00:01    \n&#91;root@Server12 ~]# scp ubuntu24.04.tar 192.168.7.11:\/root\n\u5c06Ubuntu\u7684\u955c\u50cf\u538b\u7f29\u6587\u4ef6\u6587\u4ef6\uff0c\u8fdc\u7a0b\u590d\u5236\u5230192.168.7.10:\/root\u76ee\u5f55\u4e0b\nroot@192.168.7.11's password: \nubuntu24.04.tar                                                           0%    0     0.0KB\/s   --:-- ETA1ubuntu24.04.tar                                                         100%   77MB 309.0MB\/s   00:00    \n&#91;root@Server12 ~]# <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">[root@server11 ~]# docker images&nbsp;11\u7535\u8111\u67e5\u770b\u955c\u50cf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">REPOSITORY &nbsp;&nbsp;TAG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IMAGE ID &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CREATED &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">nginx &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.26.0 &nbsp;&nbsp;&nbsp;94543a6c1aef &nbsp;&nbsp;13 months ago &nbsp;&nbsp;188MB<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001<strong>\u5907\u4efd\u955c\u50cf\u3001\u5bfc\u5165\u955c\u50cf\u7684\u5907\u4efd<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@server11 ~]# docker load -i rockylinux9.2.tar \u5c06rockylinux9.2\u7684\u955c\u50cf\u5907\u4efd\u6587\u4ef6\u5bfc\u5165\u5230dockers\u91cc\nbb25ee446163: Loading layer  181.5MB\/181.5MB\nLoaded image: rockylinux:9.2\n&#91;root@server11 ~]# docker load -i ubuntu24.04.tar  \u5c06ubuntu24.04\u7684\u955c\u50cf\u5907\u4efd\u6587\u4ef6\u5bfc\u5165\u5230dockers\u91cc\na8346d259389: Loading layer  80.62MB\/80.62MB\nLoaded image: ubuntu:latest\n\n&#91;root@server11 ~]# docker images  \u67e5\u770bdocker\u955c\u50cf\nREPOSITORY   TAG       IMAGE ID       CREATED         SIZE\nubuntu       latest    bf16bdcff9c9   6 days ago      78.1MB\nnginx        1.26.0    94543a6c1aef   13 months ago   188MB\nrockylinux   9.2       eeea865f4111   2 years ago     176MB<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5b9e\u9a8c\u73af\u5883\uff1a Rocky12\u3001Rocky11\u8fd8\u539f\u81f3\u65b0\u7cfb\u7edf\uff0c\u5f00\u673a\u3002 \u4e8c\u3001\u5b89\u88c5docker \u4e09\u3001\u62c9\u53d6\u955c\u50cf\uff1a \u56db\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[140],"class_list":["post-1843","post","type-post","status-publish","format-standard","hentry","category-linux","tag-docker"],"_links":{"self":[{"href":"http:\/\/113.45.254.23\/index.php?rest_route=\/wp\/v2\/posts\/1843","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/113.45.254.23\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/113.45.254.23\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/113.45.254.23\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/113.45.254.23\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1843"}],"version-history":[{"count":4,"href":"http:\/\/113.45.254.23\/index.php?rest_route=\/wp\/v2\/posts\/1843\/revisions"}],"predecessor-version":[{"id":2152,"href":"http:\/\/113.45.254.23\/index.php?rest_route=\/wp\/v2\/posts\/1843\/revisions\/2152"}],"wp:attachment":[{"href":"http:\/\/113.45.254.23\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/113.45.254.23\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1843"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/113.45.254.23\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}