{"id":128659,"date":"2018-11-30T10:50:21","date_gmt":"2018-11-30T02:50:21","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=128659"},"modified":"2018-11-27T09:24:52","modified_gmt":"2018-11-27T01:24:52","slug":"ubuntu-14-docker","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ubuntu-14-docker.html","title":{"rendered":"\u6559\u4f60\u5728Ubuntu 14.04\u4e0b \u5b89\u88c5 Docker"},"content":{"rendered":"
1 Docker\u7b80\u4ecb<\/strong><\/div>\n

Docker \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5e94\u7528\u5bb9\u5668\u5f15\u64ce\uff0c\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u6253\u5305\u4ed6\u4eec\u7684\u5e94\u7528\u4ee5\u53ca\u4f9d\u8d56\u5305\u5230\u4e00\u4e2a\u53ef\u79fb\u690d\u7684\u5bb9\u5668\u4e2d\uff0c\u7136\u540e\u53d1\u5e03\u5230\u4efb\u4f55\u6d41\u884c\u7684 Linux \u673a\u5668\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u865a\u62df\u5316\u3002\u5bb9\u5668\u662f\u5b8c\u5168\u4f7f\u7528\u6c99\u7bb1\u673a\u5236\uff0c\u76f8\u4e92\u4e4b\u95f4\u4e0d\u4f1a\u6709\u4efb\u4f55\u63a5\u53e3\u3002<\/p>\n

2 \u5b89\u88c5<\/strong><\/div>\n
2.1 \u901a\u8fc7\u7cfb\u7edf\u81ea\u5e26\u5305\u5b89\u88c5(\u53ef\u80fd\u4e0d\u662f\u6700\u65b0\u7248)<\/strong><\/span><\/div>\n
sudo apt-get update\r\nsudo apt-get install -y docker.io<\/pre>\n
2.2 \u6dfb\u52a0 GPG Key<\/strong><\/span><\/div>\n
curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -<\/pre>\n

\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u68c0\u67e5 GPG Key \u7684\u4fe1\u606f\u662f\u5426\u6b63\u786e<\/p>\n

sudo apt-key fingerprint 0EBFCD88<\/pre>\n

GPG Key \u7684\u4fe1\u606f\u5982\u4e0b :<\/p>\n

pub 4096R\/0EBFCD88 2017-02-22\r\nKey fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88\r\nuid Docker Release (CE deb) <docker@docker.com>\r\nsub 4096R\/F273FCD8 2017-02-22<\/pre>\n
2.3 \u6dfb\u52a0\u6e90\u4fe1\u606f<\/strong><\/span><\/div>\n

#\u5c06\u6e90\u4fe1\u606f\u76f4\u63a5\u5199\u5165\/etc\/apt\/sources.list<\/span><\/p>\n

sudo add-apt-repository \\\r\n\"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\\r\n$(lsb_release -cs)\u00a0 stable\"<\/pre>\n

OR<\/p>\n

#\u5355\u72ec\u521b\u5efadocker\u7684source.list<\/p>\n

sudo bash -c \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu trusty stable > \/etc\/apt\/sources.list.d\/docker.list\"<\/pre>\n

\u66f4\u65b0\u6e90\u4fe1\u606f<\/p>\n

sudo apt-get update<\/pre>\n

\u7531\u4e8e\u7cfb\u7edf\u4e2d\u9ed8\u8ba4\u5e26\u6709\u65e7\u7684docker\u6e90, \u786e\u8ba4docker\u7684\u6e90\u4fe1\u606f\u662f\u5426\u6b63\u786e, \u65b0\u7684\u6e90\u662f\u5426\u6dfb\u52a0\u6210\u529f<\/p>\n

apt-cache madison docker-ce<\/pre>\n

\u65b0\u7684\u6e90\u662f\u5426\u6dfb\u52a0\u6210\u529f<\/p>\n

2.4 \u5b89\u88c5<\/strong><\/span><\/div>\n
sudo apt-get install docker-ce<\/pre>\n
2.5 \u9a8c\u8bc1\u5b89\u88c5<\/strong><\/span><\/div>\n

\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u5b89\u88c5 :<\/p>\n

docker -v<\/pre>\n
2.6 \u6d4b\u8bd5docker\u8fd0\u884c<\/strong><\/span><\/div>\n

\u5f00\u542f docker \u540e\u53f0\u8fdb\u7a0b<\/p>\n

sudo service docker start<\/pre>\n

\u6821\u9a8cdocker\u662f\u5426\u5b89\u88c5\u6210\u529f<\/p>\n

sudo docker run hello-world<\/pre>\n

\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u4e0b\u8f7d\u4e00\u4e2a\u6d4b\u8bd5\u955c\u50cf, \u5e76\u4e14\u8fd0\u884c\u5728\u4e00\u4e2a\u5bb9\u5668\u4e2d. \u5f53\u5bb9\u5668\u8fd0\u884c\u65f6, \u4ed6\u4f1a\u6253\u5370\u4e00\u4e9b\u4fe1\u606f, \u5e76\u4e14\u9000\u51fa.<\/p>\n

docker_hello_world<\/pre>\n
3 \u7f51\u7edc\u4e0a\u5176\u4ed6\u65b9\u6848\uff1a<\/strong><\/div>\n

Ubuntu \u4e0b\u5b89\u88c5 Docker<\/p>\n

sudo apt-key adv --keyserver hkp:\/\/p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D\r\nsudo bash -c \"deb https:\/\/apt.dockerproject.org\/repo ubuntu-trusty main > \/etc\/apt\/sources.list.d\/docker.list\"\r\nsudo apt-get update\r\nsudo apt-get install lxc-docker<\/pre>\n

\u6216\u8005
\nUbuntu14.04 \u4e0b\u5b89\u88c5 docker<\/p>\n

sudo apt-get install apt-transport-https\r\nsudo apt-key adv --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9\r\nsudo bash -c \"echo deb https:\/\/get.docker.io\/ubuntu docker main > \/etc\/apt\/sources.list.d\/docker.list\"\r\nsudo apt-get update\r\nsudo apt-get install lxc-docker<\/pre>\n","protected":false},"excerpt":{"rendered":"

Docker \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5e94\u7528\u5bb9\u5668\u5f15\u64ce\uff0c\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u6253\u5305\u4ed6\u4eec\u7684\u5e94\u7528\u4ee5\u53ca\u4f9d\u8d56\u5305\u5230\u4e00\u4e2a\u53ef\u79fb\u690d\u7684\u5bb9\u5668\u4e2d\uff0c\u7136\u540e\u53d1\u5e03\u5230\u4efb […]<\/p>\n","protected":false},"author":63,"featured_media":128855,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-128659","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/128659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=128659"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/128659\/revisions"}],"predecessor-version":[{"id":129117,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/128659\/revisions\/129117"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/128855"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=128659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=128659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=128659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}