{"id":224781,"date":"2021-08-27T09:26:50","date_gmt":"2021-08-27T01:26:50","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=224781"},"modified":"2021-08-23T08:28:39","modified_gmt":"2021-08-23T00:28:39","slug":"docker-docker-nginx","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/docker-docker-nginx.html","title":{"rendered":"docker\u521d\u4f53\u9a8c\uff1adocker\u90e8\u7f72nginx\u670d\u52a1"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nDocker \u662f\u4e00\u4e2a\u7528\u4e8e\u5f00\u53d1\uff0c\u4ea4\u4ed8\u548c\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u653e\u5e73\u53f0\u3002Docker \u4f7f\u60a8\u80fd\u591f\u5c06\u5e94\u7528\u7a0b\u5e8f\u4e0e\u57fa\u7840\u67b6\u6784\u5206\u5f00\uff0c\u4ece\u800c\u53ef\u4ee5\u5feb\u901f\u4ea4\u4ed8\u8f6f\u4ef6\u3002\u4eca\u5929\u6765\u4e3a\u5927\u5bb6\u6f14\u793a\u4e00\u4e0bdocker\u90e8\u7f72nginx<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u73af\u5883<\/strong><\/div>\n

centos7<\/p>\n

\u5b89\u88c5docker<\/strong><\/div>\n
\u79fb\u9664\u65e7\u7248\u672cdocker<\/strong><\/span><\/div>\n
[root@chaols ~]#  sudo yum remove docker \\\r\n>                   docker-client \\\r\n>                   docker-client-latest \\\r\n>                   docker-common \\\r\n>                   docker-latest \\\r\n>                   docker-latest-logrotate \\\r\n>                   docker-logrotate \\\r\n>                   docker-engine\r\n<\/pre>\n
\u5b89\u88c5yum-utils\u5305\u5e76\u8bbe\u7f6e\u7a33\u5b9a\u5b58\u50a8\u5e93<\/strong><\/span><\/div>\n
[root@chaols ~]# yum install -y yum-utils<\/pre>\n
\u5b89\u88c5docker<\/strong><\/span><\/div>\n
[root@chaols ~]# yum install docker-ce docker-ce-cli containerd.io<\/pre>\n
\u542f\u52a8docker<\/strong><\/div>\n
[root@chaols ~]# systemctl start docker<\/pre>\n
\u67e5\u770bdocker\u955c\u50cf<\/strong><\/div>\n

\u521a\u521a\u5b89\u88c5docker\u662f\u6ca1\u6709\u955c\u50cf\u7684<\/p>\n

[root@chaols ~]# docker images\r\nREPOSITORY   TAG       IMAGE ID   CREATED   SIZE<\/pre>\n
\u90e8\u7f72nginx<\/strong><\/div>\n
\u4e0b\u8f7dnginx\u955c\u50cf<\/strong><\/span><\/div>\n
[root@chaols ~]# docker pull nginx\r\nUsing default tag: latest\r\nlatest: Pulling from library\/nginx\r\ne1acddbe380c: Pull complete \r\ne21006f71c6f: Pull complete \r\nf3341cc17e58: Pull complete \r\n2a53fa598ee2: Pull complete \r\n12455f71a9b5: Pull complete \r\nb86f2ba62d17: Pull complete \r\nDigest: sha256:4d4d96ac750af48c6a551d757c1cbfc071692309b491b70b2b8976e102dd3fef\r\nStatus: Downloaded newer image for nginx:latest\r\ndocker.io\/library\/nginx:latest<\/pre>\n
\u521b\u5efanginx\u865a\u62df\u673a<\/strong><\/span><\/div>\n

run \u8fd0\u884c -it \u4ea4\u4e92\u6a21\u5f0f --name \u6307\u5b9a\u540d\u5b57 -p \u5bbf\u4e3b\u673a\uff1adocker\u865a\u62df\u673a nginx \u955c\u50cf\u540d\u5b57 \/bin\/bash \u542f\u52a8\u5bb9\u5668\u540e\u542f\u52a8bash<\/p>\n

[root@chaols ~]# docker run -it --name chao.nginx -p 8080:80 nginx \/bin\/bash\r\nroot@8ebe4de10f2c:\/# \/etc\/init.d\/nginx start\r\n2021\/08\/21 07:58:49 [notice] 11#11: using the \"epoll\" event method\r\n2021\/08\/21 07:58:49 [notice] 11#11: nginx\/1.21.1\r\n2021\/08\/21 07:58:49 [notice] 11#11: built by gcc 8.3.0 (Debian 8.3.0-6) \r\n2021\/08\/21 07:58:49 [notice] 11#11: OS: Linux 3.10.0-1160.el7.x86_64\r\n2021\/08\/21 07:58:49 [notice] 11#11: getrlimit(RLIMIT_NOFILE): 1048576:1048576\r\nroot@8ebe4de10f2c:\/# 2021\/08\/21 07:58:49 [notice] 12#12: start worker processes\r\n2021\/08\/21 07:58:49 [notice] 12#12: start worker process 13\r\n<\/pre>\n
\u9a8c\u8bc1<\/strong><\/div>\n

\"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

centos7 [root@chaols ~]# sudo yum remove docker \\ > doc […]<\/p>\n","protected":false},"author":1469,"featured_media":224798,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-224781","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\/224781","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\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=224781"}],"version-history":[{"count":12,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/224781\/revisions"}],"predecessor-version":[{"id":225032,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/224781\/revisions\/225032"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/224798"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=224781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=224781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=224781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}