{"id":18112,"date":"2024-11-18T15:55:09","date_gmt":"2024-11-18T07:55:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18112\/"},"modified":"2024-11-18T15:55:09","modified_gmt":"2024-11-18T07:55:09","slug":"linux%e6%80%8e%e4%b9%88%e5%ae%89%e8%a3%85docker","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18112\/","title":{"rendered":"linux\u600e\u4e48\u5b89\u88c5docker"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5728 linux \u4e0a\u5b89\u88c5 docker\uff1f\u6b65\u9aa4\u5982\u4e0b\uff1a\u68c0\u67e5\u5148\u51b3\u6761\u4ef6\uff1a\u5185\u6838\u7248\u672c 3.10+\u3001ram \u2265 2gb\u3001\u7a33\u5b9a\u7f51\u7edc\u3002\u5b89\u88c5\u4f9d\u8d56\u9879\uff1aubuntu\/debian\uff1aapt-get install apt-transport-https&#8230;\uff1bcentos\/red hat\uff1ayum install yum-utils&#8230;\u6dfb\u52a0 docker \u5b98\u65b9\u4ed3\u5e93\uff1aubuntu\/debian\uff1acurl&#8230; | apt-key add -\uff1bcentos\/red hat\uff1ayum-config-manager &#8211;add-\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/03\/2024060312212133879.jpg\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u5b89\u88c5docker\u63d2\u56fe\" alt=\"linux\u600e\u4e48\u5b89\u88c5docker\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Linux \u4e0a\u5b89\u88c5 Docker<\/strong><\/p>\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u68c0\u67e5\u5148\u51b3\u6761\u4ef6<\/strong><\/p>\n<ul>\n<li>Linux \u5185\u6838\u7248\u672c 3.10 \u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>\u81f3\u5c11 2GB \u7684 RAM<\/li>\n<li>\u7a33\u5b9a\u7684\u4e92\u8054\u7f51\u8fde\u63a5<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5 Docker \u4f9d\u8d56\u9879<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Ubuntu\/Debian\uff1a<\/strong><\/p>\n<pre>sudo apt-get update\nsudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>CentOS\/Red Hat\uff1a<\/strong><\/p>\n<pre>sudo yum install -y yum-utils device-mapper-persistent-data lvm2<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u6dfb\u52a0 Docker \u5b98\u65b9\u4ed3\u5e93<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Ubuntu\/Debian\uff1a<\/strong><\/p>\n<pre>sudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\nsudo add-apt-repository \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu $(lsb_release -cs) stable\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>CentOS\/Red Hat\uff1a<\/strong><\/p>\n<pre>sudo yum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u56db\u6b65\uff1a\u5b89\u88c5 Docker<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Ubuntu\/Debian\uff1a<\/strong><\/p>\n<pre>sudo apt-get update\nsudo apt-get install docker-ce<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>CentOS\/Red Hat\uff1a<\/strong><\/p>\n<pre>sudo yum install docker-ce<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e94\u6b65\uff1a\u542f\u52a8 Docker<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Ubuntu\/Debian\uff1a<\/strong><\/p>\n<pre>sudo systemctl start docker<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>CentOS\/Red Hat\uff1a<\/strong><\/p>\n<pre>sudo systemctl start docker<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u516d\u6b65\uff1a\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5 Docker \u662f\u5426\u5df2\u6210\u529f\u5b89\u88c5\uff1a<\/p>\n<pre>docker run hello-world<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u770b\u5230\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u5185\u5bb9\u7684\u8f93\u51fa\uff0c\u5219\u8868\u793a Docker \u5df2\u6210\u529f\u5b89\u88c5\uff1a<\/p>\n<pre>Hello from Docker!\nThis message shows that your installation appears to be working correctly.<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5b89\u88c5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728 linux \u4e0a\u5b89\u88c5 docker\uff1f\u6b65\u9aa4\u5982\u4e0b\uff1a\u68c0\u67e5\u5148\u51b3\u6761\u4ef6\uff1a\u5185\u6838\u7248\u672c 3.10+\u3001ram \u2265 2gb\u3001\u7a33\u5b9a\u7f51\u7edc\u3002\u5b89\u88c5\u4f9d\u8d56\u9879\uff1aubuntu\/debian\uff1aapt-get install apt-transport-https&#8230;\uff1bcentos\/red hat\uff1ayum install yum-utils&#8230;\u6dfb\u52a0 docker \u5b98\u65b9\u4ed3\u5e93\uff1aubuntu\/debian\uff1acurl&#8230; | apt-key add -\uff1bcentos\/red hat\uff1ayum-config-manager &#8211;add- \u5982\u4f55\u5728 Linux \u4e0a\u5b89\u88c5 Docker \u7b2c\u4e00\u6b65\uff1a\u68c0\u67e5\u5148\u51b3\u6761\u4ef6 Linux \u5185\u6838\u7248\u672c 3.10 \u6216\u66f4\u9ad8\u7248\u672c \u81f3\u5c11 2GB \u7684 RAM \u7a33\u5b9a\u7684\u4e92\u8054\u7f51\u8fde\u63a5 \u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5 Docker \u4f9d\u8d56\u9879 Ubuntu\/Debian\uff1a sudo apt-get update sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common \u767b\u5f55\u540e\u590d\u5236 CentOS\/Red Hat\uff1a sudo yum install [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18112","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18112"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18112\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}