<br />
<b>Warning</b>:  is_file(): open_basedir restriction in effect. File(/www/wwwroot/blog.lybua.top//index.php/wp-json/wp/v2/posts/138) is not within the allowed path(s): (/www/wwwroot/blog.lybua.top:/tmp/:/dev/shm/nginx-cache/wp) in <b>/www/wwwroot/blog.lybua.top/wp-content/plugins/jetpack-boost/app/modules/optimizations/page-cache/pre-wordpress/class-boost-cache-utils.php</b> on line <b>80</b><br />
{"id":138,"date":"2026-06-26T18:52:54","date_gmt":"2026-06-26T10:52:54","guid":{"rendered":"https:\/\/blog.lybua.top\/?p=138"},"modified":"2026-06-26T18:52:54","modified_gmt":"2026-06-26T10:52:54","slug":"docker%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%85%a8","status":"publish","type":"post","link":"https:\/\/blog.lybua.top\/index.php\/2026\/06\/26\/docker%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%85%a8\/","title":{"rendered":"docker\u547d\u4ee4\u5927\u5168"},"content":{"rendered":"<article class=\"baidu_pl\">\n<div id=\"article_content\" class=\"article_content clearfix\">\n<div id=\"content_views\" class=\"htmledit_views atom-one-dark\">\n<h2><a name=\"t0\" href=\"\" target=\"_top\"><\/a>\u4e00\u3001\u542f\u52a8<span style=\"color: #FC5531\" class=\"new-words-blog\"><br \/>\n              \u7c7b <i style=\"background-image: url(https:\/\/i-operation.csdnimg.cn\/images\/e7c3df7a602f4267be505af7ecfc3f88.png);\" alt=\"\u7c7b\" class=\"words-blog-icon\"><\/i><br \/>\n              <\/span><\/h2>\n<h3><a name=\"t1\" href=\"\" target=\"_top\"><\/a>1. \u542f\u52a8 <span style=\"color: #3391E5\" class=\"new-words-blog\"><br \/>\n              docker<br \/>\n              <\/span><\/h3>\n<pre name=\"code\"><code>systemctl start docker<\/code><\/pre>\n<h3><a name=\"t2\" href=\"\" target=\"_top\"><\/a>2. \u5173\u95ed docker<\/h3>\n<pre name=\"code\"><code>systemctl stop docker<\/code><\/pre>\n<h3><a name=\"t3\" href=\"\" target=\"_top\"><\/a>3. \u91cd\u65b0\u542f\u52a8 docker<\/h3>\n<pre name=\"code\"><code>systemctl restart docker\n <\/code><\/pre>\n<h3><a name=\"t4\" href=\"\" target=\"_top\"><\/a>4. docker \u8bbe\u7f6e\u81ea\u542f\u52a8<\/h3>\n<pre name=\"code\"><code>systemctl enable docker<\/code><\/pre>\n<h3><a name=\"t5\" href=\"\" target=\"_top\"><\/a>5. \u67e5\u770b docker \u8fd0\u884c\u72b6\u6001<\/h3>\n<pre name=\"code\"><code>systemctl status docker<\/code><\/pre>\n<h3><a name=\"t6\" href=\"\" target=\"_top\"><\/a>6. \u67e5\u770b docker \u7248\u672c\u53f7\u7b49\u4fe1\u606f<\/h3>\n<pre name=\"code\"><code>docker version<\/code><\/pre>\n<p>\u6216\u8005<\/p>\n<pre name=\"code\"><code>docker info<\/code><\/pre>\n<p>\u8be5\u547d\u4ee4\u8fd8\u53ef\u4ee5\u67e5\u770b\u5230\u6709\u591a\u5c11 \u5bb9\u5668\u53ca\u5176\u72b6\u6001 \u548c \u955c\u50cf \u7684\u4fe1\u606f<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"698\" src=\"https:\/\/i0.wp.com\/blog.lybua.top\/wp-content\/uploads\/2026\/06\/image_1782471128394.png?resize=724%2C698&#038;ssl=1\" width=\"724\"><\/p>\n<h2><a name=\"t7\" href=\"\" target=\"_top\"><\/a>\u4e8c\u3001 \u955c\u50cf\u7c7b<\/h2>\n<h3><a name=\"t8\" href=\"\" target=\"_top\"><\/a>1. \u67e5\u770b\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker images<\/code><\/pre>\n<h3><a name=\"t9\" href=\"\" target=\"_top\"><\/a>2. \u641c\u7d22\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker search [OPTIONS] \u955c\u50cf\u540d\u5b57\ndocker search mysql<\/code><\/pre>\n<h3><a name=\"t10\" href=\"\" target=\"_top\"><\/a>3. \u62c9\u53d6\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker pull\ndocker pull mysql #\u6ca1\u6709\u5236\u5b9a\u7248\u672c\u5219\u9ed8\u8ba4\u6700\u65b0\u7248 <\/code><\/pre>\n<p><a class=\"link-info\" href=\"https:\/\/hub.docker.com\/search?type=image\" title=\"docker\u5b98\u65b9\u955c\u50cf\u5730\u5740\" rel=\"nofollow\" target=\"_top\">docker\u5b98\u65b9\u955c\u50cf\u5730\u5740<\/a><\/p>\n<h3><a name=\"t11\" href=\"\" target=\"_top\"><\/a>4. \u8fd0\u884c\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker run\ndocker run tomcat<\/code><\/pre>\n<p>\u8fd0\u884c\u955c\u50cf\u540e\u53ef\u4ee5\u6309 ctrl+c \u9000\u51fa<\/p>\n<h3><a name=\"t12\" href=\"\" target=\"_top\"><\/a>5. \u5220\u9664\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker rmi  \u955c\u50cf\u540d\/\u955c\u50cfID #\u82e5\u955c\u50cf\u5728\u8fd0\u884c\u5219\u4f1a\u62a5\u9519\ndocker rmi -f \u955c\u50cf\u540d\/\u955c\u50cfID #\u5f3a\u5236\u5220\u9664\u4e00\u4e2a\ndocker rmi -f mysql\n \ndocker rmi -f \u955c\u50cf\u540d\/\u955c\u50cfID \u955c\u50cf\u540d\/\u955c\u50cfID \u955c\u50cf\u540d\/\u955c\u50cfID #\u5220\u9664\u591a\u4e2a \u5176\u955c\u50cfID\u6216\u955c\u50cf\u7528\u7528\u7a7a\u683c\u9694\u5f00\u5373\u53ef \ndocker rmi -f mysql redis\n \ndocker rmi -f $(docker images -aq)\n#\u5220\u9664\u5168\u90e8\u955c\u50cf  -a \u610f\u601d\u4e3a\u663e\u793a\u5168\u90e8, -q \u610f\u601d\u4e3a\u53ea\u663e\u793aID<\/code><\/pre>\n<h3><a name=\"t13\" href=\"\" target=\"_top\"><\/a>6. \u52a0\u8f7d\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker load -i \u955c\u50cf\u4fdd\u5b58\u6587\u4ef6\u4f4d\u7f6e\ndocker load myimage.tar<\/code><\/pre>\n<h3><a name=\"t14\" href=\"\" target=\"_top\"><\/a>7. \u4fdd\u5b58\u955c\u50cf<\/h3>\n<pre name=\"code\"><code>docker save \u955c\u50cf\u540d\/\u955c\u50cfID -o \u955c\u50cf\u4fdd\u5b58\u4f4d\u7f6e\u548c\u540d\u5b57\ndocker save tomcat -o \/myimage.tar<\/code><\/pre>\n<h2><a name=\"t15\" href=\"\" target=\"_top\"><\/a>\u4e09\u3001\u5bb9\u5668\u7c7b<\/h2>\n<h3><a name=\"t16\" href=\"\" target=\"_top\"><\/a>1. \u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker ps\ndocker ps -a # \u67e5\u770b\u6240\u6709\u5bb9\u5668\n#\u52a0\u683c\u5f0f\u5316\u65b9\u5f0f\u8bbf\u95ee\uff0c\u683c\u5f0f\u4f1a\u66f4\u52a0\u6e05\u723d\ndocker ps --format \"table {{.ID}}\\t{{.Image}}\\t{{.Ports}}\\t{{.Status}}\\t{{.Names}}\"<\/code><\/pre>\n<h3><a name=\"t17\" href=\"\" target=\"_top\"><\/a>2. \u521b\u5efa\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker run [OPTIONS] IMAGE [COMMAND] [ARG...]\n\u5e38\u7528\u53c2\u6570\uff1a\n--name=NAME   #\u4e3a\u5bb9\u5668\u6307\u5b9a\u540d\u5b57\u4e3aNAME\uff0c\u4e0d\u4f7f\u7528\u7684\u8bdd\u7cfb\u7edf\u81ea\u52a8\u4e3a\u5bb9\u5668\u547d\u540d\n-d: \u540e\u53f0\u8fd0\u884c\u5bb9\u5668\u5e76\u8fd4\u56de\u5bb9\u5668ID\uff0c\u4e5f\u5373\u542f\u52a8\u5b88\u62a4\u5f0f\u5bb9\u5668(\u540e\u53f0\u8fd0\u884c)\uff1b\n \n-i\uff1a\u4ee5\u4ea4\u4e92\u6a21\u5f0f\u8fd0\u884c\u5bb9\u5668\uff0c\u901a\u5e38\u4e0e -t \u540c\u65f6\u4f7f\u7528\uff1b\n-t\uff1a\u4e3a\u5bb9\u5668\u91cd\u65b0\u5206\u914d\u4e00\u4e2a\u4f2a\u8f93\u5165\u7ec8\u7aef\uff0c\u901a\u5e38\u4e0e -i \u540c\u65f6\u4f7f\u7528\uff1b\n\u4e5f\u5373\u542f\u52a8\u4ea4\u4e92\u5f0f\u5bb9\u5668(\u524d\u53f0\u6709\u4f2a\u7ec8\u7aef\uff0c\u7b49\u5f85\u4ea4\u4e92\uff0c\u4e00\u822c\u8fde\u7528\uff0c\u5373-it)\uff1b\n \n-P: \u968f\u673a\u7aef\u53e3\u6620\u5c04\uff0c\u5927\u5199P\n-p: \u6307\u5b9a\u7aef\u53e3\u6620\u5c04\uff0c\u5c0f\u5199p\n \n# \u521b\u5efa\u5e76\u5141\u8bb8 Nginx \u5bb9\u5668\ndocker run -d --name nginx -p 80:80 nginx<\/code><\/pre>\n<h3><a name=\"t18\" href=\"\" target=\"_top\"><\/a>3. \u542f\u52a8\u5b88\u62a4\u5f0f\u5bb9\u5668\uff08<span class=\"words-blog hl-git-1\">\u540e\u53f0\u8fd0\u884c<\/span>\uff09<\/h3>\n<pre name=\"code\"><code>docker run -d \u5bb9\u5668\u540d\ndocker run -d redis:6.0.8<\/code><\/pre>\n<h3><a name=\"t19\" href=\"\" target=\"_top\"><\/a>4. \u505c\u6b62\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker stop \u5bb9\u5668\u540d\ndocker stop nginx<\/code><\/pre>\n<h3><a name=\"t20\" href=\"\" target=\"_top\"><\/a>5. \u542f\u52a8\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker start \u5bb9\u5668\u540d\ndocker start nginx\ndocker restart \u5bb9\u5668\u540d\ndocker restart nginx\n <\/code><\/pre>\n<h3><a name=\"t21\" href=\"\" target=\"_top\"><\/a>6. \u8fdb\u5165\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker exec -it \u5bb9\u5668\u540d bashshell\ndocker exec -it nginx \/bin\/bash```<\/code><\/pre>\n<h3><a name=\"t22\" href=\"\" target=\"_top\"><\/a>7. \u505c\u6b62\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker stop \u5bb9\u5668\u540d\ndocker stop nginx<\/code><\/pre>\n<h3><a name=\"t23\" href=\"\" target=\"_top\"><\/a>8. \u5f3a\u5236\u505c\u6b62\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>docker kill \u5bb9\u5668\u540d\ndocker kill nginx<\/code><\/pre>\n<h3><a name=\"t24\" href=\"\" target=\"_top\"><\/a>9. \u5220\u9664\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>#\u5220\u9664\u4e00\u4e2a\ndocker rm \u5bb9\u5668ID  \ndocker rm nginx\ndocker rm -f \u5bb9\u5668ID  #\u5f3a\u5236\u5220\u9664\ndocker rm -f nginx\n \n \n#\u5220\u9664\u591a\u4e2a\ndocker rm -f $(docker ps -a -q)\n\u6216\ndocker ps -a -q | xargs docker rm<\/code><\/pre>\n<h3><a name=\"t25\" href=\"\" target=\"_top\"><\/a>10. \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7<\/h3>\n<pre name=\"code\"><code>docker logs \u5bb9\u5668\u540d\ndocker logs nginx<\/code><\/pre>\n<h3><a name=\"t26\" href=\"\" target=\"_top\"><\/a>11. \u67e5\u770b\u5bb9\u5668\u5185\u8fd0\u884c\u7684\u8fdb\u7a0b<\/h3>\n<pre name=\"code\"><code>docker top \u5bb9\u5668\u540d\ndocker top nginx<\/code><\/pre>\n<h3><a name=\"t27\" href=\"\" target=\"_top\"><\/a>12. \u67e5\u770b\u5bb9\u5668\u5185\u90e8\u7ec6\u8282<\/h3>\n<pre name=\"code\"><code>docker inspect \u5bb9\u5668\u540d\ndocker inspect nginx<\/code><\/pre>\n<h3><a name=\"t28\" href=\"\" target=\"_top\"><\/a>13. \u521b\u5efa\u5bb9\u5668\u6570\u636e\u5377\u6302\u8f7d<\/h3>\n<pre name=\"code\"><code># \u521b\u5efa\u5bb9\u5668\u5e76\u6307\u5b9a\u6570\u636e\u5377\uff0c\u6ce8\u610f\u901a\u8fc7 -v \u53c2\u6570\u6765\u6307\u5b9a\u6570\u636e\u5377\ndocker run -d --name nginx -p 80:80 -v html:\/usr\/share\/nginx\/html nginx<\/code><\/pre>\n<h3><a name=\"t29\" href=\"\" target=\"_top\"><\/a>14. \u67e5\u770b\u6570\u636e\u5377<\/h3>\n<pre name=\"code\"><code>docker volume ls<\/code><\/pre>\n<h3><a name=\"t30\" href=\"\" target=\"_top\"><\/a>15. \u67e5\u770b\u6570\u636e\u5377\u8be6\u60c5<\/h3>\n<pre name=\"code\"><code>docker volume inspect \u6570\u636e\u5377\u540d\ndocker volume inspect html<\/code><\/pre>\n<h3><a name=\"t31\" href=\"\" target=\"_top\"><\/a>16. \u5220\u9664\u6570\u636e\u5377<\/h3>\n<pre name=\"code\"><code>docker volume rm \u6570\u636e\u5377\u540d\ndocker volume rm html<\/code><\/pre>\n<h2><a name=\"t32\" href=\"\" target=\"_top\"><\/a>\u56db. \u7f51\u7edc\u7c7b<\/h2>\n<h3><a name=\"t33\" href=\"\" target=\"_top\"><\/a>1. \u67e5\u770b\u7f51\u7edc<\/h3>\n<pre name=\"code\"><code>docker network ls<\/code><\/pre>\n<h3><a name=\"t34\" href=\"\" target=\"_top\"><\/a>2. \u521b\u5efa\u7f51\u7edc<\/h3>\n<pre name=\"code\"><code>docker network create \u7f51\u7edc\u540d\ndocker network create hmall<\/code><\/pre>\n<h3><a name=\"t35\" href=\"\" target=\"_top\"><\/a>3. \u67e5\u770b<span style=\"color: #3391E5\" class=\"new-words-blog\"><br \/>\n              \u7f51\u7edc\u6570\u636e<br \/>\n              <\/span>\u6e90<\/h3>\n<pre name=\"code\"><code>docker network inspect \u7f51\u7edc\u540d\ndocker network inspect hmall<\/code><\/pre>\n<h3><a name=\"t36\" href=\"\" target=\"_top\"><\/a>4. \u5220\u9664\u7f51\u7edc<\/h3>\n<pre name=\"code\"><code>docker network rm \u7f51\u7edc\u540d\ndocker nerwork rm hmall<\/code><\/pre>\n<h2><a name=\"t37\" href=\"\" target=\"_top\"><\/a>\u4e94\u3001 <span class=\"words-blog hl-git-1\">Docker compose<\/span><\/h2>\n<p><a class=\"link-info\" href=\"https:\/\/docs.docker.com\/compose\/compose-file\/legacy-versions\/\" title=\"\u5b98\u65b9\u6587\u6863\uff1a\u57fa\u672c\u8bed\u6cd5\" rel=\"nofollow\" target=\"_top\">\u5b98\u65b9\u6587\u6863\uff1a\u57fa\u672c\u8bed\u6cd5<\/a><\/p>\n<p>\u5047\u8bbedocker run <span style=\"color: #FC5531\" class=\"new-words-blog\"><br \/>\n              \u90e8\u7f72 <i style=\"background-image: url(https:\/\/i-operation.csdnimg.cn\/images\/e7c3df7a602f4267be505af7ecfc3f88.png);\" alt=\"\u90e8\u7f72\" class=\"words-blog-icon\"><\/i><br \/>\n              <\/span> <span class=\"words-blog hl-git-1\">mysql<\/span>\u547d\u4ee4\u5982\u4e0b<\/p>\n<pre name=\"code\"><code>docker run -d \\\n  --name mysql \\\n  -p 3306:3306 \\\n  -e TZ=Asia\/Shanghai \\\n  -e MYSQL_ROOT_PASSWORD=123 \\\n  -v .\/mysql\/data:\/var\/lib\/mysql \\\n  -v .\/mysql\/conf:\/etc\/mysql\/conf.d \\\n  -v .\/mysql\/init:\/docker-entrypoint-initdb.d \\\n  --network hmall\n  mysql<\/code><\/pre>\n<p>\u90a3\u4e48\u7528<span class=\"words-blog hl-git-1\">docker-compose<\/span>.yml \u6587\u4ef6\u5b9a\u4e49\u5c31\u662f\uff1a<\/p>\n<pre name=\"code\"><code>version: \"3.8\"\n \nservices:\n  mysql:\n    image: mysql\n    container_name: mysql\n    ports:\n      - \"3306:3306\"\n    environment:\n      TZ: Asia\/Shanghai\n      MYSQL_ROOT_PASSWORD: 123\n    volumes:\n      - \".\/mysql\/conf:\/etc\/mysql\/conf.d\"\n      - \".\/mysql\/data:\/var\/lib\/mysql\"\n    networks:\n      - new\nnetworks:\n  new:\n    name: hmall<\/code><\/pre>\n<h3><a name=\"t38\" href=\"\" target=\"_top\"><\/a>1. \u67e5\u770b\u5e2e\u52a9<\/h3>\n<pre name=\"code\"><code>docker-compose -h<\/code><\/pre>\n<h3><a name=\"t39\" href=\"\" target=\"_top\"><\/a>2. \u542f\u52a8\u6240\u6709\u670d\u52a1<\/h3>\n<pre name=\"code\"><code>docker-compose up\ndocker-compose up -d # \u540e\u53f0\u8fd0\u884c<\/code><\/pre>\n<h3><a name=\"t40\" href=\"\" target=\"_top\"><\/a>3. \u505c\u6b62\u5e76\u5220\u9664\u5bb9\u5668\u3001\u7f51\u7edc\u3001\u5377\u3001\u955c\u50cf\u3002<\/h3>\n<pre name=\"code\"><code>docker-compose down<\/code><\/pre>\n<h3><a name=\"t41\" href=\"\" target=\"_top\"><\/a>4. \u8fdb\u5165\u5bb9\u5668\u5b9e\u4f8b\u5185\u90e8<\/h3>\n<pre name=\"code\"><code>docker-compose exec  yml\u91cc\u9762\u7684\u670d\u52a1id<\/code><\/pre>\n<h3><a name=\"t42\" href=\"\" target=\"_top\"><\/a>5. \u5c55\u793a\u5bb9\u5668<\/h3>\n<pre name=\"code\"><code>ocker-compose ps<\/code><\/pre>\n<h3><a name=\"t43\" href=\"\" target=\"_top\"><\/a>6. \u5c55\u793a\u8fdb\u7a0b<\/h3>\n<pre name=\"code\"><code>docker-compose top<\/code><\/pre>\n<h3><a name=\"t44\" href=\"\" target=\"_top\"><\/a>7. \u67e5\u770b\u5bb9\u5668\u8f93\u51fa\u65e5\u5fd7<\/h3>\n<pre name=\"code\"><code>docker-compose logs  yml\u91cc\u9762\u7684\u670d\u52a1id<\/code><\/pre>\n<h3><a name=\"t45\" href=\"\" target=\"_top\"><\/a>8. \u68c0\u67e5\u914d\u7f6e<\/h3>\n<pre name=\"code\"><code>docker-compose config\ndocker-compose config -q # \u68c0\u67e5\u914d\u7f6e\uff0c\u6709\u95ee\u9898\u624d\u6709\u8f93\u51fa<\/code><\/pre>\n<h3><a name=\"t46\" href=\"\" target=\"_top\"><\/a>9. \u542f\u52a8\u670d\u52a1<\/h3>\n<pre name=\"code\"><code>docker-compose start<\/code><\/pre>\n<h3><a name=\"t47\" href=\"\" target=\"_top\"><\/a>10. \u91cd\u542f\u670d\u52a1<\/h3>\n<pre name=\"code\"><code>docker-compose restart<\/code><\/pre>\n<h3><a name=\"t48\" href=\"\" target=\"_top\"><\/a>11. \u505c\u6b62\u670d\u52a1<\/h3>\n<pre name=\"code\"><code>docker-compose stop<\/code><\/pre>\n<h2><a name=\"t49\" href=\"\" target=\"_top\"><\/a>\u516d\u3001 \u5176\u4ed6<\/h2>\n<h3><a name=\"t50\" href=\"\" target=\"_top\"><\/a>1. \u547d\u4ee4\u522b\u540d<\/h3>\n<pre name=\"code\"><code># \u4fee\u6539\/root\/.bashrc\u6587\u4ef6\nvi \/root\/.bashrc\n\u5185\u5bb9\u5982\u4e0b\uff1a\n# .bashrc\n \n# User specific aliases and functions\n \nalias rm='rm -i'\nalias cp='cp -i'\nalias mv='mv -i'\nalias dps='docker ps --format \"table {{.ID}}\\t{{.Image}}\\t{{.Ports}}\\t{{.Status}}\\t{{.Names}}\"'\nalias dis='docker images'\n \n# Source global definitions\nif [ -f \/etc\/bashrc ]; then\n        . \/etc\/bashrc\nfi\n#\u9000\u51fa\nexit\n:wq\n \n#\u6267\u884c\u547d\u4ee4\u4f7f\u522b\u540d\u751f\u6548\nsource \/root\/.bashrc<\/code><\/pre>\n<h2><a name=\"t51\" href=\"\" target=\"_top\"><\/a>\u516b\u3002Docker\u66f4\u6362<span class=\"words-blog hl-git-1\">\u56fd\u5185\u955c\u50cf<\/span><\/h2>\n<pre name=\"code\"><code>#!\/bin\/bash\n \n# \u521b\u5efa \/etc\/docker \u76ee\u5f55\uff0c\u5982\u679c\u76ee\u5f55\u5df2\u5b58\u5728\u5219\u4e0d\u62a5\u9519\nsudo mkdir -p \/etc\/docker\n \n# \u5199\u5165 daemon.json \u6587\u4ef6\u5185\u5bb9\nsudo tee \/etc\/docker\/daemon.json &lt;&lt;-'EOF'\n{\n    \"registry-mirrors\": [\n        \"https:\/\/dockerproxy.com\",\n        \"https:\/\/docker.mirrors.ustc.edu.cn\",\n        \"https:\/\/docker.nju.edu.cn\",\n        \"https:\/\/cr.console.aliyun.com\",\n        \"https:\/\/docker.mirrors.ustc.edu.cn\",\n        \"http:\/\/hub-mirror.c.163.com\",\n        \"https:\/\/hub.daocloud.io\",\n        \"http:\/\/mirror.azure.cn\",\n        \"https:\/\/mirror.baidubce.com\",\n        \"https:\/\/docker.mirrors.sjtug.sjtu.edu.cn\",\n        \"https:\/\/docker.nju.edu.cn\",\n        \"https:\/\/docker.hpcloud.cloud\",\n        \"https:\/\/docker.m.daocloud.io\",\n        \"https:\/\/docker.unsee.tech\",\n        \"https:\/\/docker.1panel.live\",\n        \"http:\/\/mirrors.ustc.edu.cn\",\n        \"https:\/\/docker.chenby.cn\",\n        \"http:\/\/mirror.azure.cn\",\n        \"https:\/\/dockerpull.org\",\n        \"https:\/\/dockerhub.icu\",\n        \"https:\/\/hub.rat.dev\",\n        \"https:\/\/docker.m.daocloud.io\",\n        \"https:\/\/dockerproxy.com\",\n        \"https:\/\/docker.mirrors.ustc.edu.cn\",\n        \"https:\/\/docker.nju.edu.cn\",\n        \"https:\/\/cr.console.aliyun.com\",\n        \"https:\/\/ccr.ccs.tencentyun.com\",\n        \"https:\/\/dockerproxy.com\",\n        \"https:\/\/hub-mirror.c.163.com\",\n        \"https:\/\/mirror.baidubce.com\",\n        \"https:\/\/hubgw.docker.com\", \n        \"https:\/\/docker.1ms.run\", \n        \"https:\/\/www.mirrorify.net\", \n        \"https:\/\/docker-pull.ygxz.in\", \n        \"https:\/\/docker.1yidc.com\", \n        \"https:\/\/dockerproxy.net\", \n        \"https:\/\/docker.aityp.com\", \n        \"https:\/\/www.container.fish\"\n    ]\n}\nEOF\n \n# \u91cd\u65b0\u52a0\u8f7d systemd \u914d\u7f6e\nsudo systemctl daemon-reload\n \n# \u91cd\u542f Docker \u670d\u52a1\nsudo systemctl restart docker<\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u542f\u52a8 \u7c7b 1. \u542f\u52a8 docker systemctl start docker 2. \u5173\u95ed docker [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-wenzhang"],"_links":{"self":[{"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":1,"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":139,"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/posts\/138\/revisions\/139"}],"wp:attachment":[{"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lybua.top\/index.php\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}