{"id":6471,"date":"2024-09-01T20:52:39","date_gmt":"2024-09-01T12:52:39","guid":{"rendered":"http:\/\/loc.jiyun.net\/?p=6471"},"modified":"2024-09-01T20:52:39","modified_gmt":"2024-09-01T12:52:39","slug":"docker%e6%95%99%e7%a8%8b%ef%bc%9a%e4%bb%8e%e5%85%a5%e9%97%a8%e5%88%b0%e7%b2%be%e9%80%9a","status":"publish","type":"post","link":"http:\/\/puo.cn\/?p=6471","title":{"rendered":"Docker\u6559\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u7cbe\u901a"},"content":{"rendered":"<section style=\"margin-bottom: 0px; padding-left: 10px; padding-right: 10px; background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; , pingfangsc-regular, serif;font-size: 16px; line-height: 1.5em; letter-spacing: 0em; text-align: left;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\">\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u5b89\u88c5(CentOS)<\/span><\/h2>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5378\u8f7d\u65e7\u7248\u672cDocker<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c\u4e4b\u524d\u5b89\u88c5\u8fc7\u65e7\u7248\u672c\u7684Docker\uff0c\u5219\u53ef\u4ee5\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5378\u8f7d<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">yum\u00a0remove\u00a0docker\u00a0docker-client\u00a0docker-client-latest\u00a0docker-common\u00a0docker-latest\u00a0docker-latest-logrotate\u00a0docker-logrotate\u00a0docker-selinux\u00a0docker-engine-selinux\u00a0docker-engine\u00a0docker-ce\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5gcc\u73af\u5883<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b89\u88c5gcc\u73af\u5883\u4e3b\u8981\u662f\u4e3a\u4e86\u66f4\u52a0\u987a\u5229\u7684\u5b89\u88c5Docker\u73af\u5883\uff0c\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5gcc<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">yum\u00a0-y\u00a0install\u00a0gcc\nyum\u00a0-y\u00a0install\u00a0gcc-c++\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5yum\u5de5\u5177<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5yum\u5305\u7ba1\u7406\u5de5\u5177<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">yum\u00a0install\u00a0-y\u00a0yum-utils\u00a0device-mapper-persistent-data\u00a0lvm2\u00a0--skip-broken\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u8bbe\u7f6eDocker\u955c\u50cf\u4ed3\u5e93<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5c06Docker\u4ed3\u5e93\u8bbe\u7f6e\u4e3a\u963f\u91cc\u955c\u50cf\u6e90\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">yum-config-manager\u00a0--add-repo\u00a0https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo\n\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5c06docker-ce.repo\u955c\u50cf\u4ed3\u5e93\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u955c\u50cf\u6e90\u4fee\u6539\u4e3a\u963f\u91cc\u955c\u50cf\u6e90<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">sed\u00a0-i\u00a0<span style=\"color: #98c379; line-height: 26px;\">'s\/download.docker.com\/mirrors.aliyun.com\\\/docker-ce\/g'<\/span>\u00a0\/etc\/yum.repos.d\/docker-ce.repo\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u66f4\u65b0yum\u5305\u8f6f\u4ef6\u7d22\u5f15<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u66f4\u65b0yum\u5305\u8f6f\u4ef6\u7d22\u5f15\u540e\uff0c\u6267\u884cyum\u547d\u4ee4\u5b89\u88c5\u8f6f\u4ef6\u4f1a\u5feb\u4e00\u4e9b\uff0c\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u66f4\u65b0yum\u5305\u8f6f\u4ef6\u7d22\u5f15\u3002<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">yum\u00a0makecache\u00a0fast\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5Docker<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5Docker<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">yum\u00a0-y\u00a0install\u00a0docker-ce\u00a0docker-ce-cli\u00a0containerd.io\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u542f\u52a8Docker<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u542f\u52a8Docker<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">systemctl\u00a0start\u00a0docker\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u8bbe\u7f6eDocker\u5f00\u673a\u81ea\u542f\u52a8<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u8bbe\u7f6eDocker\u5f00\u673a\u81ea\u542f\u52a8<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">systemctl\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">enable<\/span>\u00a0docker\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u67e5\u770bDocker\u7248\u672c<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u547d\u4ee4\u884c\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u67e5\u770bDocker\u7248\u672c<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0version\n\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8f93\u51fa\u7684\u7ed3\u679c\u4fe1\u606f\u5982\u4e0b\u6240\u793a<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">Client:\u00a0Docker\u00a0Engine\u00a0-\u00a0Community\n\u00a0Version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a026.0.0\n\u00a0API\u00a0version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.45\n\u00a0Go\u00a0version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0go1.21.8\n\u00a0Git\u00a0commit:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02ae903e\n\u00a0Built:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Wed\u00a0Mar\u00a020\u00a015:21:09\u00a02024\n\u00a0OS\/Arch:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0linux\/amd64\n\u00a0Context:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0default\n\nServer:\u00a0Docker\u00a0Engine\u00a0-\u00a0Community\n\u00a0Engine:\n\u00a0\u00a0Version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a026.0.0\n\u00a0\u00a0API\u00a0version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.45\u00a0(minimum\u00a0version\u00a01.24)\n\u00a0\u00a0Go\u00a0version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0go1.21.8\n\u00a0\u00a0Git\u00a0commit:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a08b79278\n\u00a0\u00a0Built:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Wed\u00a0Mar\u00a020\u00a015:20:06\u00a02024\n\u00a0\u00a0OS\/Arch:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0linux\/amd64\n\u00a0\u00a0Experimental:\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">false<\/span>\n\u00a0containerd:\n\u00a0\u00a0Version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.6.28\n\u00a0\u00a0GitCommit:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ae07eda36dd25f8a1b98dfbf587313b99c0190bb\n\u00a0runc:\n\u00a0\u00a0Version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.1.12\n\u00a0\u00a0GitCommit:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0v1.1.12-0-g51d5e94\n\u00a0docker-init:\n\u00a0\u00a0Version:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.19.0\n\u00a0\u00a0GitCommit:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0de40ad0\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u914d\u7f6e\u955c\u50cf\u52a0\u901f<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u76f4\u63a5\u590d\u5236\u4e00\u4e0b\u547d\u4ee4\u6267\u884c\u5373\u53ef<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">mkdir\u00a0-p\u00a0\/etc\/docker\ntee\u00a0\/etc\/docker\/daemon.json\u00a0&lt;&lt;-<span style=\"color: #98c379; line-height: 26px;\">'EOF'<\/span>\n{\n\u00a0\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"registry-mirrors\"<\/span>:\u00a0[<span style=\"color: #98c379; line-height: 26px;\">\"https:\/\/zz3sblpi.mirror.aliyuncs.com\"<\/span>]\n}\nEOF\nsystemctl\u00a0daemon-reload\nsystemctl\u00a0restart\u00a0docker\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u5e38\u89c1\u547d\u4ee4<\/span><\/h3>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">systemctl\u00a0daemon-reload\/\/\u91cd\u8f7d\u7cfb\u7edf\u670d\u52a1\nsystemct1\u00a01ist-unit-files-type\u00a0service\/\/\u67e5\u770b\u5168\u90e8\u670d\u52a1\u547d\u4ee4\nsystemct1\u00a0status\u00a0docker\/\/\u67e5\u770bdocker\u670d\u52a1\u72b6\u6001\nsystemct1\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">enable<\/span>\u00a0docker\/\u8bbe\u7f6edocker\u5f00\u673a\u81ea\u542f\u52a8\nsystemct1\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">disable<\/span>\u00a0docker\/\/\u5173\u95eddocker\u5f00\u673a\u542f\u52a8\nsystemct1\u00a0start\u00a0docker\/\/\u542f\u52a8docker\u670d\u52a1\nsystemctl\u00a0stop\u00a0docker\/\/\u505c\u6b62docker\u670d\u52a1\nsystemctl\u00a0restart\u00a0docker\/\/\u91cd\u542fdocker\u670d\u52a1\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u5e38\u7528\u547d\u4ee4<\/span><\/h2>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5e2e\u52a9\u542f\u52a8\u7c7b<\/span><\/h3>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5e2e\u52a9\u547d\u4ee4<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\"><code style=\"line-height: 1.8em; letter-spacing: 0em; width: auto; margin-left: 2px; margin-right: 2px; padding: 15px 4px 2px; border-style: none; border-width: 3px; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0--<span style=\"color: #e6c07b; line-height: 26px;\">help<\/span>\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5e2e\u52a9\u6587\u6863<\/span>\n\ndocker\u00a0run\u00a0--<span style=\"color: #e6c07b; line-height: 26px;\">help<\/span>\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5173\u4e8eDocker\u542f\u505c\u7b49\u547d\u4ee4<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">systemctl\u00a0daemon-reload\/\/\u91cd\u8f7d\u7cfb\u7edf\u670d\u52a1\nsystemct1\u00a01ist-unit-files-type\u00a0service\/\/\u67e5\u770b\u5168\u90e8\u670d\u52a1\u547d\u4ee4\nsystemct1\u00a0status\u00a0docker\/\/\u67e5\u770bdocker\u670d\u52a1\u72b6\u6001\nsystemct1\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">enable<\/span>\u00a0docker\/\u8bbe\u7f6edocker\u5f00\u673a\u81ea\u542f\u52a8\nsystemct1\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">disable<\/span>\u00a0docker\/\/\u5173\u95eddocker\u5f00\u673a\u542f\u52a8\nsystemct1\u00a0start\u00a0docker\/\/\u542f\u52a8docker\u670d\u52a1\nsystemctl\u00a0stop\u00a0docker\/\/\u505c\u6b62docker\u670d\u52a1\nsystemctl\u00a0restart\u00a0docker\/\/\u91cd\u542fdocker\u670d\u52a1\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u955c\u50cf\u547d\u4ee4<\/span><\/h3>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker images\uff1a\u5217\u51fa\u4e3b\u673a\u4e0a\u6240\u6709\u7684\u955c\u50cf<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5e38\u7528\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">-a: \u5217\u51fa\u672c\u5730\u6240\u6709\u955c\u50cf\uff08\u542b\u5386\u53f2\u955c\u50cf\uff09<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">-q: \u53ea\u663e\u793a\u955c\u50cfID<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"properties\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">\u5404\u4e2a\u9009\u9879\u7684\u8bf4\u660e\uff1a<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">REPOSITORY<\/span>:<span class=\"code-snippet__string\">\u8868\u793a\u955c\u50cf\u7684\u4ed3\u5e93\u6e90<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">TAG<\/span>:<span class=\"code-snippet__string\">\u955c\u50cf\u7684\u6807\u7b7e\u7248\u672c\u53f7 <\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">IMAGE<\/span> <span class=\"code-snippet__string\">ID:\u955c\u50cf<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">ID<\/span> <span class=\"code-snippet__string\">CREATED:\u955c\u50cf\u521b\u5efa\u65f6\u95f4 <\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">SZIE<\/span>:<span class=\"code-snippet__string\">\u955c\u50cf\u5927\u5c0f<\/span><\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">3. docker search: \u641c\u7d22\u67d0\u4e2a\u955c\u50cf\u662f\u5426\u5728\u8fdc\u7a0b\u4ed3\u5e93<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\"><span style=\"letter-spacing: 0em; text-indent: 0em;\">4. docker pull: \u5728\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u53d6\u67d0\u4e2a\u955c\u50cf<\/span><\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u00a0\u00a0\u00a0\u00a0docker pull [name]:tag \u9ed8\u8ba4\u4e3alatest<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u00a0\u00a0\u00a0\u00a0&#8211;limit N \u8868\u793a\u53ea\u663e\u793a\u524d\u51e0\u4e2a\u955c\u50cf<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">5. docker system df : \u67e5\u770b\u955c\u50cf\/\u5bb9\u5668\/\u6570\u636e\u5377\u6240\u5360\u7684\u7a7a\u95f4<\/p>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<figure style=\"margin-top: 10px; margin-bottom: 10px; flex-direction: column; justify-content: center; align-items: center;\"><\/figure>\n<\/section>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">6. docker rmi \u67d0\u4e2a\u955c\u50cf\u7684ID: \u5220\u9664\u67d0\u4e2a\u955c\u50cf<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u00a0\u00a0\u00a0\u00a0-f: \u5f3a\u5236\u5220\u9664\u67d0\u4e2a\u955c\u50cf<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u00a0\u00a0\u00a0\u00a0\u5220\u9664\u591a\u4e2a: docker rmi -f \u955c\u50cf\u540d1:TAG \u955c\u50cf\u540d2:TAG \u00a0\u6216 [IMAGE ID &#8230;]<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u00a0\u00a0\u00a0\u00a0\u5220\u9664\u5168\u90e8: docker rmi -f $(docker images -qa)<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u00a0\u00a0\u00a0\u00a0<strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u9762\u8bd5\u9898\uff1a\u8c08\u8c08docker\u7684\u865a\u60ac\u955c\u50cf<\/strong>\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li style=\"list-style-type: none;\">\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u662f\u4ec0\u4e48\uff1a\u4ed3\u5e93\u540d\u3001\u6807\u7b7e\u90fd\u662f&lt;none&gt;\u7684\u955c\u50cf\uff0c\u4fd7\u79f0\u865a\u60ac\u955c\u50cfdang ling image<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5bb9\u5668\u547d\u4ee4<\/span><\/h3>\n<ol class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u65b0\u5efa + \u542f\u52a8\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker run [OPTIONS] IMAGE [COMMAND] [ARG&#8230;]<\/p>\n<\/section>\n<\/li>\n<li>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"makefile\"><code><span class=\"code-snippet_outer\">--name=<span class=\"code-snippet__string\">\"\u5bb9\u5668\u65b0\u540d\u5b57\"<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">-d: \u540e\u53f0\u8fd0\u884c\u5bb9\u5668\u5e76\u8fd4\u56de\u5bb9\u5668ID\uff0c\u5373\u542f\u52a8\u5b88\u62a4\u5f0f\u5bb9\u5668<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">-i: \u4ee5\u4ea4\u4e92\u5f0f\u6a21\u5f0f\u8fd0\u884c\u5bb9\u5668\uff0c\u901a\u5e38\u4e0e-t\u540c\u65f6\u4f7f\u7528<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">-t: \u4e3a\u5bb9\u5668\u91cd\u65b0\u5206\u914d\u4e00\u4e2a\u4f2a\u7ec8\u7aef\uff0c\u901a\u5e38\u4e0e -i \u4f7f\u7528;\u4ea4\u4e92\u5f0f\u5bb9\u5668<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">-P: \u968f\u673a\u7aef\u53e3\u6620\u5c04, \u5927\u5199P<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">-p: \u6307\u5b9a\u7aef\u53e3\u6620\u5c04, \u5c0f\u5199p<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__section\">\u542f\u52a8\u4ea4\u4e92\u5f0f\u5bb9\u5668[\u524d\u53f0\u547d\u4ee4\u884c]: docker run -it ubuntu \/bin\/bash<\/span><\/span><\/code><\/pre>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker ps: \u7f57\u5217\u51fa\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u5b9e\u4f8b<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">-a: \u5217\u51fa\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668 + \u5386\u53f2\u4e0a\u8fd0\u884c\u8fc7\u7684<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">-l: \u663e\u793a\u6700\u8fd1\u521b\u5efa\u7684\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">-n: \u663e\u793a\u6700\u8fd1n\u4e2a\u521b\u5efa\u7684\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">-q: \u9759\u9ed8\u6a21\u5f0f\uff0c\u53ea\u663e\u793a\u5bb9\u5668\u7f16\u53f7<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u9000\u51fa\u5bb9\u5668<\/p>\n<\/section>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: lower-alpha;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">exit: run \u8fdb\u5bb9\u5668\uff0cexit\u9000\u51fa\uff0c\u5bb9\u5668\u505c\u6b62<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">ctrl + p + q: run \u8fdb\u53bb\u5bb9\u5668\uff0c ctrl + p + q \u9000\u51fa\uff0c\u5bb9\u5668\u4e0d\u505c\u6b62<\/section>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5bb9\u5668\u7684\u542f\u52a8\u505c\u6b62\u7b49\u64cd\u4f5c<\/p>\n<\/section>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: lower-alpha;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker start \u5bb9\u5668ID\u6216\u8005\u5bb9\u5668\u540d: \u542f\u52a8\u5df2\u505c\u6b62\u8fd0\u884c\u7684\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker restart \u5bb9\u5668ID\u6216\u8005\u5bb9\u5668\u540d: \u91cd\u542f\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker stop \u5bb9\u5668ID\u6216\u8005\u5bb9\u5668\u540d: \u505c\u6b62\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker kill \u5bb9\u5668ID\u6216\u8005\u5bb9\u5668\u540d: \u5f3a\u5236\u505c\u6b62\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker rm \u5bb9\u5668ID\u6216\u8005\u5bb9\u5668\u540d: \u5220\u9664\u5df2\u7ecf\u505c\u6b62\u7684\u5bb9\u5668 -f: \u5f3a\u5236\u5220\u9664<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker rm $(docker ps -aq):\u4e00\u6b21\u6027\u5220\u9664\u591a\u4e2a\u5df2\u505c\u6b62\u7684\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker ps -a -q | xargs docker rm: \u4e00\u6b21\u6027\u5220\u9664\u591a\u4e2a\u5bb9\u5668 \u00a0xargs:Linux\u7684\u53ef\u53d8\u53c2\u6570[\u524d\u9762\u7684\u7ed3\u679c\u4f5c\u4e3a\u53c2\u6570\u4f20\u7ed9\u540e\u9762]<\/section>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u542f\u52a8\u5b88\u62a4\u5f0f\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5927\u90e8\u5206\u573a\u666f\u4e0b\u6211\u4eec\u5e0c\u671bdocker\u5bb9\u5668\u90fd\u662f\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 -d \u6307\u5b9a\u5bb9\u5668\u7684\u540e\u53f0\u8fd0\u884c\u6a21\u5f0f<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker run -d &#8211;name:&#8221;\u5bb9\u5668\u540d\u5b57&#8221; \u5bb9\u5668\u540d\u5b57:tag<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker logs \u5bb9\u5668ID: \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker top \u5bb9\u5668ID: \u67e5\u770b\u5bb9\u5668\u5185\u8fd0\u884c\u8fdb\u7a0b<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker inspect \u5bb9\u5668ID<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u91cd\u65b0\u8fdb\u5165\u5bb9\u5668\u5e76\u4ee5\u547d\u4ee4\u884c\u4ea4\u4e92<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker exec -it \u5bb9\u5668ID \/bin\/bash\uff1a\u91cd\u65b0\u8fdb\u5165\u5230\u542f\u52a8\u7684\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker attach \u5bb9\u5668ID\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u8fdb\u5165\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u4e8c\u8005\u7684\u533a\u522b<\/strong>\uff1a<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">attach \u76f4\u63a5\u8fdb\u5165\u5bb9\u5668\u547d\u4ee4\u7ec8\u7aef\uff0c\u4e0d\u4f1a\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b \u7528 exit \u9000\u51fa\uff0c\u4f1a\u5bfc\u81f4\u5bb9\u5668\u505c\u6b62<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">exec \u662f\u5728\u5bb9\u5668\u4e2d\u6253\u5f00\u65b0\u7684\u7ec8\u7aef\uff0c\u5e76\u4e14\u53ef\u4ee5\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff0c\u7528exit\u9000\u51fa\u4e0d\u4f1a\u5bfc\u81f4\u5bb9\u5668\u505c\u6b62<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u4ece\u5bb9\u5668\u5185\u62f7\u8d1d\u6587\u4ef6\u5230\u4e3b\u673a\u4e0a<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker cp \u5bb9\u5668ID:\u5bb9\u5668\u5185\u8def\u5f84 \u76ee\u7684\u4e3b\u673a\u8def\u5f84<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5bfc\u5165\u548c\u5bfc\u51fa\u5bb9\u5668<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5bfc\u51fa\uff1adocker export \u5bb9\u5668ID &gt; \u5bfc\u51fa\u4e3b\u673a\u76ee\u5f55+\u6587\u4ef6\u540d<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5bfc\u5165\uff1acat \u6587\u4ef6\u540d.tar.gz | docker import &#8211; \u955c\u50cf\u7528\u6237\/\u955c\u50cf\u540d:\u955c\u50cf\u7248\u672c\u53f7<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u955c\u50cf<\/span><\/h2>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">UnionFS(\u8054\u5408\u6587\u4ef6\u7cfb\u7edf)<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Union\u6587\u4ef6\u7cfb\u7edf(UnionFS)\u662f\u4e00\u79cd\u5206\u5c42\u3001\u8f7b\u91cf\u7ea7\u5e76\u4e14\u9ad8\u6027\u80fd\u7684\u6587\u4ef6\u8db8\u7edf\uff0c\u5b83\u652f\u6301\u5bf9\u6587\u4ef6\u7cfb\u7edf\u7684\u4fee\u6539\u4f5c\u4e3a\u4e00\u6b21\u63d0\u4ea4\u6765\u4e00\u5c42\u5c42\u7684\u53e0\u52a0\uff0c\u540c\u65f6\u53ef\u4ee5\u5c06\u4e0d\u540c\u76ee\u5f55\u6302\u8f7d\u5230\u540c\u4e00\u4e2a\u865a\u62df\u6587\u4ef6\u7cfb\u7edf\u4e0b(unite several directories into a single virtualfilesystem)\u3002Union\u6587\u4ef6\u7cfb\u7edf\u662fDocker\u955c\u50cf\u7684\u57fa\u7840\u3002\u955c\u50cf\u53ef\u4ee5\u901a\u8fc7\u5206\u5c42\u6765\u8fdb\u884c\u7ee7\u627f\uff0c\u57fa\u4e8e\u57fa\u7840\u955c\u50cf\uff08\u6ca1\u6709\u7236\u955c\u50cf\uff09\uff0c\u53ef\u4ee5\u5236\u4f5c\u5404\u79cd\u5177\u4f53\u7684\u5e94\u7528\u955c\u50cf\u3002<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7279\u6027\uff1a\u4e00\u6b21\u540c\u65f6\u52a0\u8f7d\u591a\u4e2a\u6587\u4ef6\u7cfb\u7edf\uff0c\u4f46\u4ece\u5916\u9762\u770b\u8d77\u6765\uff0c\u53ea\u80fd\u770b\u5230\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf\uff0c\u8054\u5408\u52a0\u8f7d\u4f1a\u628a\u5404\u5c42\u6587\u4ef6\u7cfb\u7edf\u53e0\u52a0\u8d77\u6765<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u955c\u50cf\u52a0\u8f7d\u7684\u539f\u7406<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">docker\u7684\u955c\u50cf\u5b9e\u9645\u4e0a\u7531\u4e00\u5c42\u4e00\u5c42\u7684\u6587\u4ef6\u7cfb\u7edf\u7ec4\u6210\uff0c\u8fd9\u79cd\u5c42\u7ea7\u7684\u6587\u4ef6\u7cfb\u7edfUnionFS\u3002bootfs(boot file system)\u4e3b\u8981\u5305\u542bbootloader\u548ckernel,,bootloader\u4e3b\u8981\u662f\u5f15\u5bfc\u52a0\u8f7dkernel,.Linux\u521a\u542f\u52a8\u65f6\u4f1a\u52a0\u8f7dpootfs\u6587\u4ef6\u7cfb\u7edf\uff0c<strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u5728Docker\u955c\u50cf\u7684\u6700\u5e95\u5c42\u662f\u5f15\u5bfc\u6587\u4ef6\u7cfb\u7edfbootfs<\/strong>\u3002\u8fd9\u4e00\u5c42\u4e0e\u6211\u4eec\u5178\u578b\u7684Linux\/Unix.\u7cfb\u7edf\u662f\u4e00\u6837\u7684\uff0c\u5305\u542bboot\u52a0\u8f7d\u5668\u548c\u5185\u6838\u3002\u5f53boot\u52a0\u8f7d\u5b8c\u6210\u4e4b\u540e\u6574\u4e2a\u5185\u6838\u5c31\u90fd\u5728\u5185\u5b58\u4e2d\u4e86\uff0c\u6b64\u65f6\u5185\u5b58\u7684\u4f7f\u7528\u6743\u5df2\u7531bootfs\u8f6c\u4ea4\u7ed9\u5185\u6838\uff0c\u6b64\u65f6\u7cfb\u7edf\u4e5f\u4f1a\u5378\u8f7dbootfs\u3002<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><em style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u6ce8\u610f\uff1a<\/em>Docker\u955c\u50cf\u5c42\u90fd\u662f\u53ea\u8bfb\u7684\uff0c\u5bb9\u5668\u5c42\u662f\u53ef\u5199\u7684<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u955c\u50cf\u7684commit\u547d\u4ee4<\/span><\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u6848\u4f8b\uff1a<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">ubuntu\u5b89\u88c5vim<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0run\u00a0-it\u00a0ubuntu\u00a0\/bin\/bash\n\napt-get\u00a0update\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u4e0b\u8f7dVim<\/span>\napt-get\u00a0install\u00a0-y\u00a0vim\n\ndocker\u00a0commit\u00a0-m=<span style=\"color: #98c379; line-height: 26px;\">\"Add\u00a0vim\"<\/span>\u00a0-a=<span style=\"color: #98c379; line-height: 26px;\">\"XiaoHao\"<\/span>\u00a0e556d80dd0a1\u00a0chen\/myubuntu:1.1\n\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">commit \u63d0\u4ea4\u955c\u50cf\uff1adocker commit -m=&#8221;\u63d0\u4ea4\u7684\u4fe1\u606f&#8221; -a=&#8221;\u4f5c\u8005&#8221; \u5bb9\u5668ID \u8981\u521b\u5efa\u7684\u76ee\u6807\u955c\u50cf\u540d:[\u6807\u7b7e\u540d]<\/p>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u5bb9\u5668\u5377<\/span><\/h2>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5751\uff1a\u5728Docker\u5bb9\u5668\u6302\u5728\u76ee\u5f55\u65f6\u9700\u8981\u52a0\u4e00\u4e2a\u53c2\u6570 &#8211;privileged=true \u53c2\u6570<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u53c2\u6570 -v :\u8bbe\u7f6e\u6302\u5728\u6570\u636e\u5377\u7684\u76ee\u5f55\u5728\u4e3b\u673a\u4e2d\u5b9e\u73b0\u6570\u636e\u7684\u6301\u4e45\u5316<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7279\u70b9\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6570\u636e\u5377\u53ef\u5728\u5bb9\u5668\u4e4b\u95f4\u5171\u4eab\u6216\u91cd\u7528\u6570\u636e<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u5377\u4e2d\u66f4\u6539\u53ef\u4ee5\u76f4\u63a5\u751f\u6548<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6570\u636e\u5377\u4e2d\u7684\u66f4\u6539\u4e0d\u4f1a\u5305\u542b\u5728\u955c\u50cf\u7684\u66f4\u65b0\u4e2d<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6570\u636e\u5377\u7684\u751f\u547d\u5468\u671f\u4e00\u76f4\u6301\u7eed\u5230\u6ca1\u6709\u5bb9\u5668\u4f7f\u7528\u5b83\u4e3a\u6b62<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u6570\u636e\u5377\u7684\u6dfb\u52a0<\/span><\/h3>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u516c\u5f0f\uff1adocker run -it -v \/\u5bbf\u4e3b\u673a\u76ee\u5f55:\/\u5bb9\u5668\u5185\u76ee\u5f55 \u955c\u50cf\u540d<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u8bfb\u5199\u89c4\u5219\u8bf4\u660e\uff1a<\/section>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: square; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u8bfb\u5199(\u9ed8\u8ba4): rw<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u53ea\u8bfb: ro<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u5377\u7684\u7ee7\u627f\u548c\u5171\u4eab<\/section>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: square; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u5bb9\u56681\u4e0e\u5bbf\u4e3b\u673a\u5171\u4eab\uff1adocker run -it &#8211;privileged=true -v \/tmp\/host_data:\/tmp\/u &#8211;name u1 ubuntu<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u5bb9\u56682\u7ee7\u627f\u5bb9\u56681\u548c\u5bbf\u4e3b\u673a\u7684\u5377\u89c4\u5219\uff1adocker run -it &#8211;privileged=true &#8211;volumes-from \u7236\u7c7b \u00a0&#8211;name u2 ubuntu<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6bcf\u4e00\u4e2a\u5bb9\u5668\u4e4b\u95f4\u4e92\u4e0d\u5f71\u54cd\uff0c\u53ea\u662f\u7ee7\u627f\u7236\u7c7b\u7684\u6570\u636e\u5377\u6302\u8f7d\u89c4\u5219<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker\u5b89\u88c5\u5e38\u7528\u8f6f\u4ef6<\/span><\/h2>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5\u6b65\u9aa4<\/span><\/h3>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u641c\u7d22\u955c\u50cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u62c9\u53d6\u955c\u50cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u67e5\u770b\u955c\u50cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u542f\u52a8\u955c\u50cf<\/section>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: lower-alpha;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u670d\u52a1\u7aef\u53e3\u7684\u6620\u5c04\u4ee5\u53ca\u6570\u636e\u5377\u7684\u6302\u8f7d<\/section>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u505c\u6b62\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u79fb\u9664\u5bb9\u5668<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Tomcat\u5b89\u88c5<\/span><\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5Tomcat\u6309\u7167\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u62c9\u53d6\u955c\u50cf<\/span>\ndocker\u00a0pull\u00a0tomcat\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u67e5\u770b\u955c\u50cf\u662f\u5426\u88ab\u62c9\u53d6\u5230\u672c\u5730<\/span>\ndocker\u00a0images\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u542f\u52a8\u955c\u50cf\u5e76\u6307\u5b9a\u7aef\u53e3<\/span>\ndocker\u00a0run\u00a0-d\u00a0-p\u00a08080:8080\u00a0--name\u00a0t1\u00a0tomcat\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u542f\u52a8\u4e4b\u540e\u8bbf\u95eetomcat\u4f1a\u51fa\u73b0404\uff0c\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6267\u884c rm -r webapps \u547d\u4ee4\uff0c\u5220\u9664 webapps \u76ee\u5f55<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6267\u884c mv webapps.dist webapps\u547d\u4ee4<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u518d\u6b21\u8bbf\u95ee\u5373\u53ef\u6210\u529f\u8bbf\u95ee<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u4e0b\u8f7d\u514d\u4fee\u6539\u7248 Tomcat<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0run\u00a0-d\u00a0-p\u00a08080:8080\u00a0--name\u00a0tomcat8\u00a0billygoo\/tomcat8-jdk8\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5MySQL<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b89\u88c5MySQL\u6309\u7167\u4ee5\u4e0b\u547d\u4ee4\u5728\u547d\u4ee4\u884c\u6267\u884c<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u62c9\u53d6\u955c\u50cf<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u62c9\u53d6MySQL\u955c\u50cf\u5728\u547d\u4ee4\u884c\u6267\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0pull\u00a0mysql:5.7\n\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u5b9e\u6218\u7248\u542f\u52a8MySQL<\/strong>\uff1a<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0run\u00a0-d\u00a0-p\u00a03306:3306\u00a0--privileged=<span style=\"color: #56b6c2; line-height: 26px;\">true<\/span>\u00a0\\\n-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/mysql\/<span style=\"color: #e6c07b; line-height: 26px;\">log<\/span>:\/var\/<span style=\"color: #e6c07b; line-height: 26px;\">log<\/span>\/mysql\u00a0\\\n-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/mysql\/data:\/var\/lib\/mysql\u00a0\\\n-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/mysql\/conf:\/etc\/mysql\/conf.d\u00a0\\\n-e\u00a0MYSQL_ROOT_PASSWORD=123456\u00a0\\\n--name\u00a0mysql\u00a0mysql:5.7\n\n<\/code><\/pre>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">-p: \u6620\u5c04\u4e3b\u673a\u4e0e\u5bb9\u5668\u4e4b\u95f4\u7684\u7aef\u53e3<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">&#8211;privileged=true: \u4fee\u6539\u5bb9\u5668\u6743\u9650<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">-v: \u6302\u8f7d\u6570\u636e\u5377\uff0c\u628aMySQL\u7684\u6570\u636e\u3001\u65e5\u5fd7\u548c\u914d\u7f6e\u90fd\u6302\u8f7d\u5230\u4e3b\u673a\u4e0a<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">-e: MySQL\u7684\u5bc6\u7801<\/section>\n<\/li>\n<\/ul>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u65b0\u5efamy.cnf: \u901a\u8fc7\u5bb9\u5668\u6570\u636e\u5377\u540c\u6b65\u7ed9mysql\u5bb9\u5668\u5b9e\u4f8b\u2014\u2014\u89e3\u51b3\u4e2d\u6587\u4e71\u7801\u95ee\u9898<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u4fee\u6539\u914d\u7f6e\u6587\u4ef6my.cnf<\/strong><\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">[client]\ndefault_character_set=utf8\n[mysqld]\ncollation_server\u00a0=\u00a0utf8_general_ci\ncharacter_set_server\u00a0=\u00a0utf8\n\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u6539\u5b8c\u914d\u7f6e\u6587\u4ef6\u91cd\u542fmysql<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0restart\u00a0mysql\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u518d\u6b21\u8fdb\u5165mysql\u5bb9\u5668<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">exec<\/span>\u00a0-it\u00a0\u5bb9\u5668ID\u00a0\/bin\/bash\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u767b\u5f55mysql\u67e5\u770b\u5b57\u7b26\u96c6\u7f16\u7801<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">mysql\u00a0-uroot\u00a0-p\u5bc6\u7801\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u5728\u5bb9\u5668\u5185\u6267\u884c<\/span>\nshow\u00a0variables\u00a0like\u00a0<span style=\"color: #98c379; line-height: 26px;\">'character%'<\/span>;\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u7ed3\u679c\u5982\u4e0b<\/span>\n+--------------------------+----------------------------+\n|\u00a0Variable_name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0Value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n+--------------------------+----------------------------+\n|\u00a0character_set_client\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0utf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_set_connection\u00a0|\u00a0utf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_set_database\u00a0\u00a0\u00a0|\u00a0utf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_set_filesystem\u00a0|\u00a0binary\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_set_results\u00a0\u00a0\u00a0\u00a0|\u00a0utf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_set_server\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0utf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_set_system\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0utf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\n|\u00a0character_sets_dir\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0\/usr\/share\/mysql\/charsets\/\u00a0|\n+--------------------------+----------------------------+\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5Redis<\/span><\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u62c9\u53d6\u955c\u50cf<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0pull\u00a0redis:6.2.6\n\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u542f\u52a8Redis<\/span><\/h4>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0run\u00a0-p\u00a06379:6379\u00a0--name\u00a0redis\u00a0--privileged=<span style=\"color: #56b6c2; line-height: 26px;\">true<\/span>\u00a0\\\n-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/redis\/redis.conf:\/etc\/redis\/redis.conf\u00a0\\\n-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/redis\/data:\/data\u00a0\\\n-d\u00a0redis:6.2.6\u00a0redis-server\u00a0\/etc\/redis\/redis.conf\u00a0\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5minio<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0pull\u00a0bitnami\/minio\n\n\ndocker\u00a0run\u00a0\\\n&gt;\u00a0-p\u00a09000:9000\u00a0\\\n&gt;\u00a0-p\u00a09001:9001\u00a0\\\n&gt;\u00a0--name\u00a0minio\u00a0\\\n&gt;\u00a0-d\u00a0\\\n&gt;\u00a0--restart=always\u00a0\\\n&gt;\u00a0-e\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"MINIO_ROOT_USER=root\"<\/span>\u00a0\\\n&gt;\u00a0-e\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"MINIO_ROOT_PASSWORD=32345678\"<\/span>\u00a0\\\n&gt;\u00a0-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/soft\/minio\/data:\/data\u00a0\\\n&gt;\u00a0-v\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/soft\/minio\/config:\/root\/.minio\u00a0\\\n&gt;\u00a0minio\/minio\u00a0\\\n&gt;\u00a0server\u00a0\\\n&gt;\u00a0\/data\u00a0\\\n&gt;\u00a0--console-address\u00a0<span style=\"color: #98c379; line-height: 26px;\">\":9000\"<\/span>\u00a0\\\n&gt;\u00a0--address\u00a0<span style=\"color: #98c379; line-height: 26px;\">\":9001\"<\/span>\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">DockerFile<\/span><\/h2>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u662f\u4ec0\u4e48<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Dockerfile\u662f\u7528\u6765\u6784\u5efaDocker\u955c\u50cf\u7684\u6587\u672c\u6587\u4ef6\uff0c\u662f\u7531\u4e00\u6761\u6761\u6784\u5efa\u955c\u50cf\u6240\u9700\u7684\u6307\u4ee4\u548c\u53c2\u6570\u6784\u6210\u7684\u811a\u672c\u3002<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6784\u5efa\u4e09\u6b65\u9aa4\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u7f16\u5199Dockerfile\u6587\u4ef6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker build\u547d\u4ee4\u6784\u5efa\u955c\u50cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker run\u4f9d\u955c\u50cf\u8fd0\u884c\u5bb9\u5668\u5b9e\u4f8b<\/section>\n<\/li>\n<\/ul>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">DockerFile\u6784\u5efa\u8fc7\u7a0b\u89e3\u6790<\/span><\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">DockerFile\u57fa\u7840\u77e5\u8bc6<\/span><\/h4>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6bcf\u6761\u4fdd\u7559\u5b57\u6307\u4ee4\u90fd\u5fc5\u987b\u4e3a\u5927\u5199\u4e14\u540e\u9762\u8981\u8ddf\u968f\u81f3\u5c11\u4e00\u4e2a\u53c2\u6570<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6307\u4ee4\u6309\u7167\u4ece\u4e0a\u5230\u4e0b\uff0c\u987a\u5e8f\u6267\u884c<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">#\u8868\u793a\u6ce8\u91ca<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6bcf\u6761\u6307\u4ee4\u90fd\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\u5c42\u5e76\u5bf9\u955c\u50cf\u8fdb\u884c\u63d0\u4ea4<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">DockerFile\u7684\u5927\u81f4\u6267\u884c\u6d41\u7a0b<\/span><\/h4>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker\u4ece\u57fa\u7840\u955c\u50cf\u8fd0\u884c\u4e00\u4e2a\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6267\u884c\u4e00\u6761\u6307\u4ee4\u5e76\u5bf9\u5bb9\u5668\u4f5c\u51fa\u4fee\u6539<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6267\u884c\u7c7b\u4f3cdocker commitl\u7684\u64cd\u4f5c\u63d0\u4ea4\u4e00\u4e2a\u65b0\u7684\u955c\u50cf\u5c42<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">docker\u518d\u57fa\u4e8e\u521a\u63d0\u4ea4\u7684\u955c\u50cf\u8fd0\u884c\u4e00\u4e2a\u65b0\u5bb9\u5668<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6267\u884cdockerfile\u4e2d\u7684\u4e0b\u4e00\u6761\u6307\u4ee4\u76f4\u5230\u6240\u6709\u6307\u4ee4\u90fd\u6267\u884c\u5b8c\u6210<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">DockerFile\u4fdd\u7559\u5b57\u4ecb\u7ecd<\/span><\/h4>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">FROM: \u57fa\u7840\u955c\u50cf\u2014\u5236\u5b9a\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u955c\u50cf\u4f5c\u4e3a\u6a21\u7248(\u7b2c\u4e00\u6761\u5fc5\u987b\u4e3aFROM)<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">MAINTAINER: \u955c\u50cf\u7ef4\u62a4\u4f5c\u8005\u7684\u540d\u5b57<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">RUN: \u5bb9\u5668\u6784\u5efa\u65f6\u9700\u8981\u8fd0\u884c\u7684\u547d\u4ee4\u2014\u5728docker build\u65f6\u8fd0\u884c<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: square; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">shell\u683c\u5f0f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">exec\u683c\u5f0f<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">EXPOSE: \u5f53\u524d\u5bb9\u5668\u5bf9\u5916\u66b4\u9732\u7684\u7aef\u53e3<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">WORKDIR: \u6307\u5b9a\u5728\u521b\u5efa\u5bb9\u5668\u540e\uff0c\u7ec8\u7aef\u9ed8\u8ba4\u767b\u5f55\u7684\u8fdb\u6765\u5de5\u4f5c\u7684\u76ee\u5f55\uff0c\u4e00\u4e2a\u843d\u811a\u70b9<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">USER: \u6307\u5b9a\u8be5\u7528\u6237\u4ee5\u4ec0\u4e48\u6837\u7684\u7528\u6237\u53bb\u6267\u884c\uff0c\u4e0d\u6307\u5b9a\u9ed8\u8ba4\u4e3aroot<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">ENV: \u7528\u6765\u5728\u6784\u5efa\u955c\u50cf\u4e2d\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">ADD: \u5c06\u5bbf\u4e3b\u673a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u62f7\u8d1d\u8fdb\u955c\u50cf\u4e14\u4f1a\u81ea\u52a8\u5904\u7406URL\u548c\u89e3\u538btar\u538b\u7f29\u5305<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">COPY:<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; flex-direction: column; justify-content: center; align-items: center;\"><figcaption style=\"font-size: 14px; line-height: 1.5em; letter-spacing: 0em; text-align: center; margin-top: 5px;\">image-20240404183320569<\/figcaption><\/figure>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">VOLUME: \u5bb9\u5668\u5377\uff0c\u7528\u4e8e\u6570\u636e\u4fdd\u5b58\u548c\u6301\u4e45\u5316\u5de5\u4f5c<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">CMD: \u6307\u5b9a\u5bb9\u5668\u542f\u52a8\u540e\u8981\u5e72\u7684\u4e8b\u60c5<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: square; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u591a\u4e2aCMD\u53c2\u6570\uff0c\u53ea\u6709\u6700\u540e\u4e00\u4e2a\u751f\u6548\uff0cCMD\u4f1a\u88abdocker run \u4e4b\u540e\u7684\u53c2\u6570\u66ff\u6362<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">RUN\u662f\u5728docker build \u65f6\u8fd0\u884c<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">CMD\u662f\u5728docker run \u65f6\u8fd0\u884c<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">ENTRYPOINT: \u6307\u5b9a\u4e00\u4e2a\u5bb9\u5668\u8fd0\u884c\u65f6\u8981\u8fd0\u884c\u7684\u547d\u4ee4<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: square; margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">ENTRYPOINT\u4e0d\u4f1a\u88abdocker run \u540e\u9762\u7684\u547d\u4ee4\u8986\u76d6\uff0c\u800c\u662f\u4f1a\u628a\u8fd9\u4e9b\u53c2\u6570\u9001\u7ed9\u6307\u5b9a\u7684ENTRYPOINT\u6307\u4ee4\u6307\u5b9a\u7684\u7a0b\u5e8f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u4f18\u70b9: \u5728\u6267\u884cdocker run\u7684\u65f6\u5019\u53ef\u4ee5\u6307\u5b9aENTRYPOINT\u8fd0\u884c\u6240\u9700\u7684\u53c2\u6570\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6ce8\u610f: \u5982\u679cDockerfile\u4e2d\u5982\u679c\u5b58\u5728\u591a\u4e2aENTRYPOINT\u6307\u4ee4\uff0c\u4ec5\u6700\u540e\u4e00\u4e2a\u751f\u6548\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u6848\u4f8b\u5b9e\u6218<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">DockerFile\u6784\u5efa\u955c\u50cf\uff1aCentOS\u955c\u50cf\u5177\u5907vim + ifconfig + jdk8<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u7f16\u5199\u51c6\u5907DockerFile\u6587\u4ef6\u2014\u2014\u5927\u5199\u5b57\u6bcdD<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\"><code style=\"line-height: 1.8em; letter-spacing: 0em; width: auto; margin-left: 2px; margin-right: 2px; padding: 15px 4px 2px; border-style: none; border-width: 3px; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span style=\"color: #c678dd; line-height: 26px;\">FROM<\/span>\u00a0centos:<span style=\"color: #d19a66; line-height: 26px;\">7.9<\/span>.<span style=\"color: #d19a66; line-height: 26px;\">2009<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">MAINTAINER<\/span>\u00a0xiaohao&lt;xiaohao@<span style=\"color: #d19a66; line-height: 26px;\">126<\/span>.com&gt;\n\n<span style=\"color: #c678dd; line-height: 26px;\">ENV<\/span>\u00a0MYPATH\u00a0\/usr\/local\n<span style=\"color: #c678dd; line-height: 26px;\">WORKDIR<\/span><span style=\"line-height: 26px;\">\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$MYPATH<\/span><\/span>\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u5b89\u88c5vim\u7f16\u8f91\u5668<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">RUN<\/span><span style=\"line-height: 26px;\">\u00a0yum\u00a0-y\u00a0install\u00a0vim<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u5b89\u88c5ifconfig\u547d\u4ee4\u67e5\u770b\u7f51\u7edcIP<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">RUN<\/span><span style=\"line-height: 26px;\">\u00a0yum\u00a0-y\u00a0install\u00a0net-tools<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u5b89\u88c5java8\u53calib\u5e93<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">RUN<\/span><span style=\"line-height: 26px;\">\u00a0yum\u00a0-y\u00a0install\u00a0glibc.i686<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">RUN<\/span><span style=\"line-height: 26px;\">\u00a0mkdir\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/java<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#ADD\u00a0\u662f\u76f8\u5bf9\u8def\u5f84jar,\u628ajdk-8u391-linux-x64.tar.gz\u6dfb\u52a0\u5230\u5bb9\u5668\u4e2d,\u5b89\u88c5\u5305\u5fc5\u987b\u8981\u548cDockerfile\u6587\u4ef6\u5728\u540c\u4e00\u4f4d\u7f6e<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">ADD<\/span><span style=\"line-height: 26px;\">\u00a0jdk-8u391-linux-x64.tar.gz\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/java\/<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u914d\u7f6ejava\u73af\u5883\u53d8\u91cf<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">ENV<\/span>\u00a0JAVA_HOME\u00a0\/usr\/local\/java\/jdk1.<span style=\"color: #d19a66; line-height: 26px;\">8.0<\/span>_391\n<span style=\"color: #c678dd; line-height: 26px;\">ENV<\/span>\u00a0JRE_HOME\u00a0$JAVA_HOME\/jre\n<span style=\"color: #c678dd; line-height: 26px;\">ENV<\/span>\u00a0CLASSPATH\u00a0$JAVA_HOME\/lib\/dt.jar:$JAVA_HOME\/lib\/tools.jar:$JRE_HOME\/lib:$CLASSPATH\n<span style=\"color: #c678dd; line-height: 26px;\">ENV<\/span>\u00a0PATH\u00a0$JAVA_HOME\/bin:$PATH\n\n<span style=\"color: #c678dd; line-height: 26px;\">EXPOSE<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">80<\/span>\n\n<span style=\"color: #c678dd; line-height: 26px;\">CMD<\/span><span style=\"line-height: 26px;\">\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">echo<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">$MYPATH<\/span><\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">CMD<\/span><span style=\"line-height: 26px;\">\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">echo<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"success--------------ok\"<\/span><\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">CMD<\/span><span style=\"line-height: 26px;\">\u00a0\/bin\/bash<\/span>\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u6784\u5efa\u955c\u50cf<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker build -t \u65b0\u955c\u50cf\u7684\u540d\u5b57:tag .<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u8fd0\u884c\u65b0\u955c\u50cf<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">docker run -it \u65b0\u955c\u50cf\u540d\u5b57:tag<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u865a\u60ac\u955c\u50cf<\/span><\/h4>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u662f\u4ec0\u4e48\uff1a\u4ed3\u5e93\u540d\u3001\u6807\u7b7e\u90fd\u662f&lt;none&gt;\u7684\u955c\u50cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u67e5\u770b\uff1adocker images ls -f dangling=true<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u5220\u9664\uff1adocker image prune<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Docker-compose\u5bb9\u5668\u7f16\u6392<\/span><\/h2>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Docker-compose\u662fDocker\u5b98\u65b9\u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u5b9e\u73b0\u5bf9Docker\u5bb9\u5668\u96c6\u7fa4\u7684\u5feb\u901f\u7f16\u6392<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5Docker-compose<\/span><\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u4e0b\u8f7ddocker-compose<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4e0b\u8f7ddocker-compose<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">curl\u00a0-SL\u00a0https:\/\/github.com\/docker\/compose\/releases\/download\/v2.17.3\/docker-compose-linux-x86_64\u00a0-o\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/bin\/docker-compose\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u4fee\u6539\u6587\u4ef6\u7684\u6267\u884c\u6743\u9650<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">chmod\u00a0+x\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/bin\/docker-compose\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u521b\u5efa\u8f6f\u8fde\u63a5<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">In\u00a0-s\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/bin\/docker-compose\u00a0\/usr\/bin\/docker-compose\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u67e5\u770bdocker-compose\u7248\u672c<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\u7248\u672c\u4fe1\u606f<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker-compose\u00a0--version\n<\/code><\/pre>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5378\u8f7ddocker-compose<\/span><\/h4>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5378\u8f7d\uff1a<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">rm\u00a0\/usr\/<span style=\"color: #e6c07b; line-height: 26px;\">local<\/span>\/bin\/docker-compose\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Compose\u6838\u5fc3\u6982\u5ff5<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u4e00\u4e2a\u6587\u4ef6<\/strong>\uff1adocker-compose.yml<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u4e24\u8981\u7d20<\/strong>\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u670d\u52a1\uff1a\u4e00\u4e2a\u5e94\u7528\u5bb9\u5668\u5b9e\u4f8b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u5de5\u7a0b\uff1a\u7531\u4e00\u7ec4\u5173\u8054\u7684\u5bb9\u5668\u7ec4\u6210\u7684\u4e00\u4e2a\u5b8c\u6574\u7684\u4e1a\u52a1\u5355\u5143\uff0c\u5728docker-compose.yml\u6587\u4ef6\u4e2d\u7ba1\u7406<\/section>\n<\/li>\n<\/ul>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Compose\u4f7f\u7528\u4e09\u6b65\u9aa4<\/span><\/h3>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u7f16\u5199Dockerfile\u5b9a\u4e49\u5404\u4e2a\u5fae\u670d\u52a1\u5e94\u7528\u5e76\u6784\u5efa\u51fa\u5bf9\u5e94\u7684\u955c\u50cf\u6587\u4ef6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u4f7f\u7528docker-compose.yml\u5b9a\u4e49\u4e00\u4e2a\u5b8c\u6574\u7684\u670d\u52a1\u5355\u5143\uff0c\u5b89\u6392\u597d\u6574\u4f53\u5e94\u7528\u4e2d\u7684\u5404\u4e2a\u5bb9\u5668\u670d\u52a1<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\">\u6267\u884cdocker-compose up\u547d\u4ee4\u6765\u542f\u52a8\u5e76\u8fd0\u884c\u6574\u4e2a\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b8c\u6210\u4e00\u952e\u90e8\u7f72<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Compose\u5e38\u7528\u547d\u4ee4<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Compose\u5e38\u7528\u547d\u4ee4\uff1a<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"objectivec\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u67e5\u770b\u5e2e\u52a9<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose -h<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u542f\u52a8\u6240\u6709docker--compose\u670d\u52a1                     <\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose\u00a0up\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u542f\u52a8\u6240\u6709docker-compose\u670d\u52a1\u5e76\u540e\u53f0\u8fd0\u884c\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose\u00a0up\u00a0-d\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u505c\u6b62\u5e76\u5220\u9664\u5bb9\u5668\u3001\u7f51\u7edc\u3001\u5377\u3001\u955c\u50cf\u3002\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose down     <\/span><\/code><code><span class=\"code-snippet_outer\"> <span class=\"code-snippet__meta\">#\u8fdb\u5165\u5bb9\u5668\u5b9e\u4f8b\u5185\u90e8docker-compose exec docker-compose.yml\u6587\u4ef6\u4e2d\u5199\u7684\u670d\u52a1id \/bin\/bash<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose exec yml\u91cc\u9762\u7684\u670d\u52a1<span class=\"code-snippet__keyword\">id<\/span> <\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u5c55\u793a\u5f53\u524ddocker-compose\u7f16\u6392\u8fc7\u7684\u8fd0\u884c\u7684\u6240\u6709\u5bb9\u5668   <\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose ps<\/span><\/code><code><span class=\"code-snippet_outer\"> <span class=\"code-snippet__meta\">#\u5c55\u793a\u5f53\u524ddocker-compose\u7f16\u6392\u8fc7\u7684\u5bb9\u5668\u8fdb\u7a0b                    <\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose\u00a0top\u00a0<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u67e5\u770b\u5bb9\u5668\u8f93\u51fa\u65e5\u5fd7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose logs yml\u91cc\u9762\u7684\u670d\u52a1<span class=\"code-snippet__keyword\">id<\/span>  <\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u68c0\u67e5\u914d\u7f6e  <\/span><\/span><\/code><code><span class=\"code-snippet_outer\">dokcer-compose config  <\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u68c0\u67e5\u914d\u7f6e\uff0c\u6709\u95f4\u9898\u624d\u6709\u8f93\u51fa               <\/span><\/span><\/code><code><span class=\"code-snippet_outer\">dokcer-compose config -q  <\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u00a0\u91cd\u542f\u670d\u52a1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose restart<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">#\u00a0\u542f\u52a8\u670d\u52a1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose start<\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\"># \u505c\u6b62\u670d\u52a1                                                                                 <\/span><\/span><\/code><code><span class=\"code-snippet_outer\">docker-compose\u00a0stop\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 1.8em; letter-spacing: 0em;\"><span style=\"font-size: 20px; font-weight: bold; letter-spacing: 0em;\">\u53d1\u5e03\u5fae\u670d\u52a1\u5230docker<\/span><\/section>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u7f16\u5199Dockerfile\u6587\u4ef6<\/strong><\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u57fa\u7840\u955c\u50cf\u4f7f\u7528java<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">FROM<\/span>\u00a0java:<span style=\"color: #d19a66; line-height: 26px;\">8<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u4f5c\u8005<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">MAINTAINER<\/span>\u00a0chen\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#VOLUME\u6307\u5b9a\u4e34\u65f6\u6587\u4ef6\u76ee\u5f55\u4e3a\/tmp,\u5728\u4e3b\u673avar\/lib\/docker\u76ee\u5f55\u4e0b\u521b\u5efa\u4e86\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6\u5e76\u94fe\u63a5\u5230\u5bb9\u5668\u7684tmp<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">VOLUME<\/span><span style=\"line-height: 26px;\">\u00a0\/tmp<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u5c06jar\u5305\u6dfb\u52a0\u5230\u5bb9\u5668\u4e2d\u5e76\u66f4\u540d\u4e3aapp_docker..jar<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">ADD<\/span><span style=\"line-height: 26px;\">\u00a0docker\u00a0boot-0.0.1-SNAPSHOT.jar\u00a0app_docker.jar<\/span>\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u8fd0\u884cjar\u5305<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">RUN<\/span><span style=\"line-height: 26px;\">\u00a0bash\u00a0-c\u00a0<span style=\"color: #98c379; line-height: 26px;\">'touch\u00a0\/app_docker.jar<\/span><\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">ENTRYPOINT<\/span><span style=\"line-height: 26px;\"><span style=\"color: #98c379; line-height: 26px;\">\u00a0[\"java\",\"-jar\",\"\/chen_docker.jar\"]<\/span><\/span>\n\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u66b4\u97326001\u7aef\u53e3\u4f5c\u4e3a\u5fae\u670d\u52a1<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">EXPOSE<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">6001<\/span>\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u6784\u5efa\u955c\u50cf<\/strong><\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0build\u00a0-t\u00a0app_docker:1.6\u00a0.\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u7f16\u5199docker-compose.yml\u6587\u4ef6<\/strong><\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span style=\"color: #d19a66; line-height: 26px;\">version:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"3\"<\/span>\n\u00a0\n<span style=\"color: #d19a66; line-height: 26px;\">services:<\/span>\u00a0\n\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">microService:<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">image:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">chen_docker:1.6<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">container_name:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">ms01<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">ports:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"6001:6001\"<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">volumes:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/app\/microService:\/data<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">networks:<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">app_net<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">depends_on:<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">redis<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">mysql<\/span>\n\u00a0\n\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">redis:<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">image:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">redis:6.0.8<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">ports:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"6379:6379\"<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">volumes:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/app\/redis\/redis.conf:\/etc\/redis\/redis.conf<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/app\/redis\/data:\/data<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">networks:<\/span>\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">app_net<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">command:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">redis-server<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/etc\/redis\/redis.conf<\/span>\n\u00a0\n\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">mysql:<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">image:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">mysql:5.7<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">environment:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">MYSQL_ROOT_PASSWORD:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">'123456'<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">MYSQL_ALLOW_EMPTY_PASSWORD:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">'no'<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">MYSQL_DATABASE:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">'db2021'<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">MYSQL_USER:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">'chen'<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">MYSQL_PASSWORD:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">'chen123'<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">ports:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"3306:3306\"<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">volumes:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/app\/mysql\/db:\/var\/lib\/mysql<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/app\/mysql\/conf\/my.cnf:\/etc\/my.cnf<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\/app\/mysql\/init:\/docker-entrypoint-initdb.d<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">networks:<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">-<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">app_net<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">command:<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">--default-authentication-plugin=mysql_native_password<\/span>\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u89e3\u51b3\u5916\u90e8\u65e0\u6cd5\u8bbf\u95ee<\/span>\n\u00a0\n<span style=\"color: #d19a66; line-height: 26px;\">networks:<\/span>\u00a0\n\u00a0\u00a0\u00a0<span style=\"color: #d19a66; line-height: 26px;\">app_net:<\/span>\u00a0\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"background-attachment: scroll; background-image: none; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-radius: 0px;\">\u4fee\u6539yml\u6587\u4ef6\uff1a<\/strong>\u628a\u4e4b\u524d\u4f7f\u7528\u7684\u56fa\u5b9aip\u5730\u5740\u4fee\u6539\u4e3a\u670d\u52a1<\/p>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 22px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">Portainer\u53ef\u89c6\u5316\u5de5\u5177<\/span><\/h2>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Portainer\u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u7684\u5e94\u7528\uff0c\u5b83\u63d0\u4f9b\u4e86\u56fe\u5f62\u5316\u754c\u9762\uff0c\u7528\u4e8e\u65b9\u4fbf\u5730\u7ba1\u7406Docker\u73af\u5883\uff0c\u5305\u62ec\u5355\u673a\u73af\u5883\u548c\u96c6\u7fa4\u73af\u955c\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 20px; line-height: 1.5em; letter-spacing: 0em; font-weight: bold;\">\u5b89\u88c5Portainer\u5de5\u5177<\/span><\/h3>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre style=\"border-radius: 5px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">docker\u00a0run\u00a0-d\u00a0-p\u00a08000:8000\u00a0-p\u00a09000:9000\u00a0--name\u00a0portainer\u00a0\u00a0\u00a0\u00a0\u00a0--restart=always\u00a0\u00a0\u00a0\u00a0\u00a0-v\u00a0\/var\/run\/docker.sock:\/var\/run\/docker.sock\u00a0\u00a0\u00a0\u00a0\u00a0-v\u00a0portainer_data:\/data\u00a0\u00a0portainer\/portainer\n<\/code><\/pre>\n<p style=\"line-height: 1.8em; letter-spacing: 0em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\u901a\u8fc7\u6d4f\u89c8\u5668\u8f93\u5165\u5730\u5740http:\/\/localhost:9000\u5373\u53ef\u8bbf\u95ee\uff0c\u9996\u6b21\u8bbf\u95ee\u9700\u8981\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><figcaption style=\"font-size: 14px; line-height: 1.5em; letter-spacing: 0em; text-align: center; margin-top: 5px;\"><span style=\"letter-spacing: 0em;\">image-20240719165658666<\/span><\/figcaption><figcaption style=\"font-size: 14px; line-height: 1.5em; letter-spacing: 0em; text-align: center; margin-top: 5px;\"><span style=\"letter-spacing: 0em;\">\u00a0<\/span><\/figcaption><\/figure>\n<\/section>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker\u5b89\u88c5(CentOS) \u5378\u8f7d\u65e7\u7248\u672cDocker \u5982\u679c\u4e4b\u524d\u5b89\u88c5\u8fc7\u65e7\u7248\u672c\u7684Docker\uff0c\u5219\u53ef\u4ee5\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5378\u8f7d yum\u00a0remove\u00a0docker\u00a0docker-client\u00a0docker-client-latest\u00a0docker-c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141],"tags":[109],"topic":[],"class_list":["post-6471","post","type-post","status-publish","format-standard","hentry","category-tools-soft","tag-109"],"_links":{"self":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/6471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6471"}],"version-history":[{"count":0,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/6471\/revisions"}],"wp:attachment":[{"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6471"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6471"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=6471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}