{"id":33161,"date":"2023-08-12T11:30:35","date_gmt":"2023-10-04T19:30:58","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/"},"modified":"2024-04-30T18:12:17","modified_gmt":"2024-04-30T10:12:17","slug":"%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/","title":{"rendered":"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d"},"content":{"rendered":"<p>\u4f60\u597d\u3002<br \/>\n\u6211\u662fZOZO Technologies\u5f00\u53d1\u90e8\u7684\u6749\u5c71\u3002<\/p>\n<p>\u4e3a\u4e86\u5c06nginx\u7684Docker\u955c\u50cf\u4fdd\u5b58\u5728\u79c1\u6709\u4ed3\u5e93\u4e2d\uff0c\u6211\u9700\u8981\u5148\u4ecenginx\u7684\u5b98\u65b9\u521b\u5efa\u4e00\u4e2aDockerfile\u3002<\/p>\n<p>\u5728Docker Hub\u4e0a\u6709\u5b98\u65b9\u955c\u50cf\uff0c\u4f46\u5728\u8fd0\u8425\u670d\u52a1\u65f6\uff0c\u4f7f\u7528\u5f00\u53d1\u9636\u6bb5\u7684\u201c\u4e0d\u53ef\u53d8\u955c\u50cf\u201d\u5e76\u5728\u79c1\u6709\u4ed3\u5e93\u4e2d\u4fdd\u5b58\u53ef\u4ee5\u786e\u4fdd\u7a33\u5b9a\u8fd0\u8425\u548c\u5b89\u5168\u6027\u3002<\/p>\n<h1>\u6b65\u9aa4<\/h1>\n<p>\u6839\u636e\u5b98\u65b9\u9875\u9762\u7684\u53c2\u8003\uff0c\u521b\u5efaDockerfile\u3002<\/p>\n<blockquote><p>\u4ee5\u4e0b\u662fDocker\u5b98\u65b9\u63d0\u4f9b\u7684Nginx\u955c\u50cf\u7684\u94fe\u63a5\uff1ahttps:\/\/hub.docker.com\/_\/nginx\/<\/p><\/blockquote>\n<p>\u8fd9\u6b21\u6211\u4eec\u5c06\u4f7f\u75281.15.8-alpine\u7248\u672c\u3002<\/p>\n<h2>\u6211\u5c06\u521b\u5efaDockerfile\u3002<\/h2>\n<p>Dockerfile \u53ef\u4ee5\u7528\u539f\u751f\u7684\u4e2d\u6587\u8868\u8fbe\u5982\u4e0b\uff1aDockerfile \u6587\u4ef6<\/p>\n<pre class=\"post-pre\"><code>FROM alpine:3.9\r\n\r\nLABEL maintainer=\"NGINX Docker Maintainers &lt;docker-maint@nginx.com&gt;\"\r\n\r\nENV NGINX_VERSION 1.15.8\r\n\r\nRUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \\\r\n    &amp;&amp; CONFIG=\"\\\r\n        --prefix=\/etc\/nginx \\\r\n        --sbin-path=\/usr\/sbin\/nginx \\\r\n        --modules-path=\/usr\/lib\/nginx\/modules \\\r\n        --conf-path=\/etc\/nginx\/nginx.conf \\\r\n        --error-log-path=\/var\/log\/nginx\/error.log \\\r\n        --http-log-path=\/var\/log\/nginx\/access.log \\\r\n        --pid-path=\/var\/run\/nginx.pid \\\r\n        --lock-path=\/var\/run\/nginx.lock \\\r\n        --http-client-body-temp-path=\/var\/cache\/nginx\/client_temp \\\r\n        --http-proxy-temp-path=\/var\/cache\/nginx\/proxy_temp \\\r\n        --http-fastcgi-temp-path=\/var\/cache\/nginx\/fastcgi_temp \\\r\n        --http-uwsgi-temp-path=\/var\/cache\/nginx\/uwsgi_temp \\\r\n        --http-scgi-temp-path=\/var\/cache\/nginx\/scgi_temp \\\r\n        --user=nginx \\\r\n        --group=nginx \\\r\n        --with-http_ssl_module \\\r\n        --with-http_realip_module \\\r\n        --with-http_addition_module \\\r\n        --with-http_sub_module \\\r\n        --with-http_dav_module \\\r\n        --with-http_flv_module \\\r\n        --with-http_mp4_module \\\r\n        --with-http_gunzip_module \\\r\n        --with-http_gzip_static_module \\\r\n        --with-http_random_index_module \\\r\n        --with-http_secure_link_module \\\r\n        --with-http_stub_status_module \\\r\n        --with-http_auth_request_module \\\r\n        --with-http_xslt_module=dynamic \\\r\n        --with-http_image_filter_module=dynamic \\\r\n        --with-http_geoip_module=dynamic \\\r\n        --with-threads \\\r\n        --with-stream \\\r\n        --with-stream_ssl_module \\\r\n        --with-stream_ssl_preread_module \\\r\n        --with-stream_realip_module \\\r\n        --with-stream_geoip_module=dynamic \\\r\n        --with-http_slice_module \\\r\n        --with-mail \\\r\n        --with-mail_ssl_module \\\r\n        --with-compat \\\r\n        --with-file-aio \\\r\n        --with-http_v2_module \\\r\n    \" \\\r\n    &amp;&amp; addgroup -S nginx \\\r\n    &amp;&amp; adduser -D -S -h \/var\/cache\/nginx -s \/sbin\/nologin -G nginx nginx \\\r\n    &amp;&amp; apk add --no-cache --virtual .build-deps \\\r\n        gcc \\\r\n        libc-dev \\\r\n        make \\\r\n        openssl-dev \\\r\n        pcre-dev \\\r\n        zlib-dev \\\r\n        linux-headers \\\r\n        curl \\\r\n        gnupg1 \\\r\n        libxslt-dev \\\r\n        gd-dev \\\r\n        geoip-dev \\\r\n    &amp;&amp; curl -fSL https:\/\/nginx.org\/download\/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \\\r\n    &amp;&amp; curl -fSL https:\/\/nginx.org\/download\/nginx-$NGINX_VERSION.tar.gz.asc  -o nginx.tar.gz.asc \\\r\n    &amp;&amp; export GNUPGHOME=\"$(mktemp -d)\" \\\r\n    &amp;&amp; found=''; \\\r\n    for server in \\\r\n        ha.pool.sks-keyservers.net \\\r\n        hkp:\/\/keyserver.ubuntu.com:80 \\\r\n        hkp:\/\/p80.pool.sks-keyservers.net:80 \\\r\n        pgp.mit.edu \\\r\n    ; do \\\r\n        echo \"Fetching GPG key $GPG_KEYS from $server\"; \\\r\n        gpg --keyserver \"$server\" --keyserver-options timeout=10 --recv-keys \"$GPG_KEYS\" &amp;&amp; found=yes &amp;&amp; break; \\\r\n    done; \\\r\n    test -z \"$found\" &amp;&amp; echo &gt;&amp;2 \"error: failed to fetch GPG key $GPG_KEYS\" &amp;&amp; exit 1; \\\r\n    gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \\\r\n    &amp;&amp; rm -rf \"$GNUPGHOME\" nginx.tar.gz.asc \\\r\n    &amp;&amp; mkdir -p \/usr\/src \\\r\n    &amp;&amp; tar -zxC \/usr\/src -f nginx.tar.gz \\\r\n    &amp;&amp; rm nginx.tar.gz \\\r\n    &amp;&amp; cd \/usr\/src\/nginx-$NGINX_VERSION \\\r\n    &amp;&amp; .\/configure $CONFIG --with-debug \\\r\n    &amp;&amp; make -j$(getconf _NPROCESSORS_ONLN) \\\r\n    &amp;&amp; mv objs\/nginx objs\/nginx-debug \\\r\n    &amp;&amp; mv objs\/ngx_http_xslt_filter_module.so objs\/ngx_http_xslt_filter_module-debug.so \\\r\n    &amp;&amp; mv objs\/ngx_http_image_filter_module.so objs\/ngx_http_image_filter_module-debug.so \\\r\n    &amp;&amp; mv objs\/ngx_http_geoip_module.so objs\/ngx_http_geoip_module-debug.so \\\r\n    &amp;&amp; mv objs\/ngx_stream_geoip_module.so objs\/ngx_stream_geoip_module-debug.so \\\r\n    &amp;&amp; .\/configure $CONFIG \\\r\n    &amp;&amp; make -j$(getconf _NPROCESSORS_ONLN) \\\r\n    &amp;&amp; make install \\\r\n    &amp;&amp; rm -rf \/etc\/nginx\/html\/ \\\r\n    &amp;&amp; mkdir \/etc\/nginx\/conf.d\/ \\\r\n    &amp;&amp; mkdir -p \/usr\/share\/nginx\/html\/ \\\r\n    &amp;&amp; install -m644 html\/index.html \/usr\/share\/nginx\/html\/ \\\r\n    &amp;&amp; install -m644 html\/50x.html \/usr\/share\/nginx\/html\/ \\\r\n    &amp;&amp; install -m755 objs\/nginx-debug \/usr\/sbin\/nginx-debug \\\r\n    &amp;&amp; install -m755 objs\/ngx_http_xslt_filter_module-debug.so \/usr\/lib\/nginx\/modules\/ngx_http_xslt_filter_module-debug.so \\\r\n    &amp;&amp; install -m755 objs\/ngx_http_image_filter_module-debug.so \/usr\/lib\/nginx\/modules\/ngx_http_image_filter_module-debug.so \\\r\n    &amp;&amp; install -m755 objs\/ngx_http_geoip_module-debug.so \/usr\/lib\/nginx\/modules\/ngx_http_geoip_module-debug.so \\\r\n    &amp;&amp; install -m755 objs\/ngx_stream_geoip_module-debug.so \/usr\/lib\/nginx\/modules\/ngx_stream_geoip_module-debug.so \\\r\n    &amp;&amp; ln -s ..\/..\/usr\/lib\/nginx\/modules \/etc\/nginx\/modules \\\r\n    &amp;&amp; strip \/usr\/sbin\/nginx* \\\r\n    &amp;&amp; strip \/usr\/lib\/nginx\/modules\/*.so \\\r\n    &amp;&amp; rm -rf \/usr\/src\/nginx-$NGINX_VERSION \\\r\n    \\\r\n    # Bring in gettext so we can get `envsubst`, then throw\r\n    # the rest away. To do this, we need to install `gettext`\r\n    # then move `envsubst` out of the way so `gettext` can\r\n    # be deleted completely, then move `envsubst` back.\r\n    &amp;&amp; apk add --no-cache --virtual .gettext gettext \\\r\n    &amp;&amp; mv \/usr\/bin\/envsubst \/tmp\/ \\\r\n    \\\r\n    &amp;&amp; runDeps=\"$( \\\r\n        scanelf --needed --nobanner --format '%n#p' \/usr\/sbin\/nginx \/usr\/lib\/nginx\/modules\/*.so \/tmp\/envsubst \\\r\n            | tr ',' '\\n' \\\r\n            | sort -u \\\r\n            | awk 'system(\"[ -e \/usr\/local\/lib\/\" $1 \" ]\") == 0 { next } { print \"so:\" $1 }' \\\r\n    )\" \\\r\n    &amp;&amp; apk add --no-cache --virtual .nginx-rundeps $runDeps \\\r\n    &amp;&amp; apk del .build-deps \\\r\n    &amp;&amp; apk del .gettext \\\r\n    &amp;&amp; mv \/tmp\/envsubst \/usr\/local\/bin\/ \\\r\n    \\\r\n    # Bring in tzdata so users could set the timezones through the environment\r\n    # variables\r\n    &amp;&amp; apk add --no-cache tzdata \\\r\n    \\\r\n    # forward request and error logs to docker log collector\r\n    &amp;&amp; ln -sf \/dev\/stdout \/var\/log\/nginx\/access.log \\\r\n    &amp;&amp; ln -sf \/dev\/stderr \/var\/log\/nginx\/error.log\r\n\r\nCOPY nginx.conf \/etc\/nginx\/nginx.conf\r\nCOPY nginx.vh.default.conf \/etc\/nginx\/conf.d\/default.conf\r\n\r\nEXPOSE 80\r\n\r\nSTOPSIGNAL SIGTERM\r\n\r\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\r\n\r\n<\/code><\/pre>\n<h2>\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\u3002<\/h2>\n<p>nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre class=\"post-pre\"><code>user  nginx;\r\nworker_processes  1;\r\n\r\nerror_log  \/var\/log\/nginx\/error.log warn;\r\npid        \/var\/run\/nginx.pid;\r\n\r\n\r\nevents {\r\n    worker_connections  1024;\r\n}\r\n\r\n\r\nhttp {\r\n    include       \/etc\/nginx\/mime.types;\r\n    default_type  application\/octet-stream;\r\n\r\n    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '\r\n                      '$status $body_bytes_sent \"$http_referer\" '\r\n                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';\r\n\r\n    access_log  \/var\/log\/nginx\/access.log  main;\r\n\r\n    sendfile        on;\r\n    #tcp_nopush     on;\r\n\r\n    keepalive_timeout  65;\r\n\r\n    #gzip  on;\r\n\r\n    include \/etc\/nginx\/conf.d\/*.conf;\r\n}\r\n<\/code><\/pre>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7684nginx\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>server {\r\n    listen       80;\r\n    server_name  localhost;\r\n\r\n    #charset koi8-r;\r\n    #access_log  \/var\/log\/nginx\/host.access.log  main;\r\n\r\n    location \/ {\r\n        root   \/usr\/share\/nginx\/html;\r\n        index  index.html index.htm;\r\n    }\r\n\r\n    #error_page  404              \/404.html;\r\n\r\n    # redirect server error pages to the static page \/50x.html\r\n    #\r\n    error_page   500 502 503 504  \/50x.html;\r\n    location = \/50x.html {\r\n        root   \/usr\/share\/nginx\/html;\r\n    }\r\n\r\n    # proxy the PHP scripts to Apache listening on 127.0.0.1:80\r\n    #\r\n    #location ~ \\.php$ {\r\n    #    proxy_pass   http:\/\/127.0.0.1;\r\n    #}\r\n\r\n    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n    #\r\n    #location ~ \\.php$ {\r\n    #    root           html;\r\n    #    fastcgi_pass   127.0.0.1:9000;\r\n    #    fastcgi_index  index.php;\r\n    #    fastcgi_param  SCRIPT_FILENAME  \/scripts$fastcgi_script_name;\r\n    #    include        fastcgi_params;\r\n    #}\r\n\r\n    # deny access to .htaccess files, if Apache's document root\r\n    # concurs with nginx's one\r\n    #\r\n    #location ~ \/\\.ht {\r\n    #    deny  all;\r\n    #}\r\n}\r\n\r\n<\/code><\/pre>\n<h2>\u642d\u5efa<\/h2>\n<p>\u7528\u6807\u7b7e\u6784\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;nginx&#8221;\u7684\u955c\u50cf\u3002<\/p>\n<pre class=\"post-pre\"><code>docker build -t nginx:v.1.15.8 .\/\r\n<\/code><\/pre>\n<p>\u786e\u8ba4\u662f\u5426\u5f62\u6210\u4e86\u5370\u8c61\u3002<\/p>\n<pre class=\"post-pre\"><code>$ docker images\r\nREPOSITORY      TAG       IMAGE ID      CREATED       SIZE\r\nnginx    \u3000\u3000\u3000  1.15.8    xxxxxxxxx    1 hour ago     109MB\r\n<\/code><\/pre>\n<p>\u6211\u5bf9\u57fa\u672c\u6982\u5ff5\u6709\u4e86\u4e00\u4e2a\u521d\u6b65\u5370\u8c61\u3002<\/p>\n<h2>\u542f\u52a8\u5bb9\u5668\u5e76\u8fdb\u884c\u786e\u8ba4\u8bd5\u8bd5\u770b\u3002<\/h2>\n<p>\u4f7f\u7528docker\u547d\u4ee4\u6765\u542f\u52a8<\/p>\n<pre class=\"post-pre\"><code>docker run -d -it --name nginx -p 8080:80 --hostname localhost nginx:v.1.15.8\r\n<\/code><\/pre>\n<p>\u5f53\u542f\u52a8\u540e\uff0c\u5c1d\u8bd5\u8bbf\u95eehttp:\/\/localhost:8080\/\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d166a37434c4406c01238\/25-0.png\" alt=\"image.PNG\" \/><\/div>\n<p>\u542f\u52a8\u6210\u529f\u3002<\/p>\n<h2>\u5c1d\u8bd5\u4f7f\u7528docker-compose\u542f\u52a8\uff08\u6700\u5c11\u914d\u7f6e\uff09\u3002<\/h2>\n<p>\u521b\u5efa\u4e00\u4e2adocker-compose\u6587\u4ef6\u3002<\/p>\n<p>docker-compose.yml\u7684\u4e2d\u6587\u91ca\u4e49\u662f&#8221;\u5bb9\u5668\u7ec4\u5408&#8221;\u7684yml\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>version: \"2\"\r\nservices:\r\n  web:\r\n    build: .\r\n    ports:\r\n      - \"8080:80\"\r\n\r\n<\/code><\/pre>\n<p>\u6211\u4f1a\u8bd5\u4e00\u8bd5\u3002<\/p>\n<pre class=\"post-pre\"><code>$ docker-compose up -d\r\n<\/code><\/pre>\n<p>\u8bf7\u8bd5\u7740\u542f\u52a8\u5e76\u8bbf\u95eehttp:\/\/localhost:8080\/\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d166a37434c4406c01238\/34-0.png\" alt=\"image.PNG\" \/><\/div>\n<p>\u8fd9\u8fb9\u4e5f\u53ef\u4ee5\u542f\u52a8\u3002<\/p>\n<h2>\u5c06\u6587\u4ef6\u63a8\u9001\u81f3Azure ACR\uff08Azure\u5bb9\u5668\u6ce8\u518c\u8868\uff09\u3002<\/h2>\n<p>\u4f7f\u7528AzureCLI\u548cdocker\u547d\u4ee4\uff0c\u5c06\u60a8\u7684ACR\u5b58\u50a8\u5e93\u63a8\u9001\u5230\u60a8\u81ea\u5df1\u7684ACR\u5b58\u50a8\u5e93\u4e2d\u3002<\/p>\n<p>\u5728\u672c\u5730\u6784\u5efa\u7684\u955c\u50cf\u4e0a\u521b\u5efa\u4e0eACR\u5c42\u6b21\u7ed3\u6784\u76f8\u5339\u914d\u7684\u522b\u540d\uff0c\u5e76\u5c06\u5176\u63a8\u9001\u3002<\/p>\n<p>\u628a\u5b9e\u9645\u6b65\u9aa4\u8f6c\u5316\u4e3a\u7b80\u5355\u7684Shell\u811a\u672c, \u65b9\u4fbf\u5730\u53ef\u4ee5\u7528\u4e00\u4e2a\u70b9\u51fb\u5b8c\u6210\u3002<\/p>\n<p>docker-push.sh \u53ef\u4ee5\u5728\u4e2d\u56fd\u672c\u5730\u8fdb\u884c\u63a8\u9001\u64cd\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code>#!\/usr\/bin\/env bash\r\n\r\necho \"-----------------------------------------------------\";\r\necho \"-----------------------------------------------------\";\r\necho \"--------      Azure ACR Docker Push Shell     -------\";\r\necho \"--------   ---------------------------------  -------\";\r\n\r\necho \"Please enter image tag. e.g.[v.0.0.1] :\"\r\nread tag\r\n\r\nif [ -z $tag ] ; then\r\n\r\n    echo \"stdin error\"\r\n    exit\r\nelse\r\n    #acr\u30ed\u30b0\u30a4\u30f3\r\n    az login\r\n    az acr login --resource-group &lt;YOUR_ACR_RESOURECE_GROUP&gt; --name &lt;YOUR_ACR_REGISTORY_NAME&gt;\r\n\r\n    #\u30a4\u30e1\u30fc\u30b8\u4f5c\u6210\r\n    docker build -t nginx:${tag} .\/\r\n\r\n    #\u30a4\u30e1\u30fc\u30b8\u304c\u3067\u304d\u305f\u3053\u3068\u3092\u78ba\u8a8d\r\n    docker images\r\n\r\n    #\u30a8\u30a4\u30ea\u30a2\u30b9\u4f5c\u6210\r\n    docker tag nginx:${tag} &lt;YOUR_ACR_REGISTORY_NAME&gt;.azurecr.io\/nginx:${tag}\r\n\r\n    #\u30a8\u30a4\u30ea\u30a2\u30b9\u304c\u3067\u304d\u305f\u3053\u3068\u3092\u78ba\u8a8d\r\n    docker images\r\n\r\n    #\u30d7\u30c3\u30b7\u30e5\r\n    docker push &lt;YOUR_ACR_REGISTORY_NAME&gt;.azurecr.io\/nginx:${tag}\r\n\r\nfi\r\n\r\n<\/code><\/pre>\n<p>\u8fdb\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code>$ .\/docker-push.sh\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>-----------------------------------------------------\r\n-----------------------------------------------------\r\n--------      Azure ACR Docker Push Shell     -------\r\n--------   ---------------------------------  -------\r\n\r\nPlease enter image tag. e.g.[v.0.0.1] :\r\nv.1.15.8\r\n<\/code><\/pre>\n<p>\u8f93\u5165\u6807\u7b7e\u5e76\u6309\u4e0b\u56de\u8f66\u952e\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u8fdb\u884caz login\u8eab\u4efd\u9a8c\u8bc1\uff0c\u5904\u7406\u5f00\u59cb\u5e76\u4e14\u5feb\u901f\u5b8c\u6210\u63a8\u9001\u3002<\/p>\n<p>\u5f53\u4f60\u6210\u529f\u4e86\uff0c\u5c31\u5728Azure\u95e8\u6237\u4e0a\u786e\u8ba4\u4e00\u4e0b\u5427\u3002<\/p>\n<p>\u4ee5\u4e0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f60\u597d\u3002 \u6211\u662fZOZO Technologies\u5f00\u53d1\u90e8\u7684\u6749\u5c71\u3002 \u4e3a\u4e86\u5c06nginx\u7684Docker\u955c\u50cf\u4fdd\u5b58\u5728\u79c1\u6709\u4ed3\u5e93 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33161","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5236\u4f5c\u4e00\u4e2anginx\u7684docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d\" \/>\n<meta property=\"og:description\" content=\"\u4f60\u597d\u3002 \u6211\u662fZOZO Technologies\u5f00\u53d1\u90e8\u7684\u6749\u5c71\u3002 \u4e3a\u4e86\u5c06nginx\u7684Docker\u955c\u50cf\u4fdd\u5b58\u5728\u79c1\u6709\u4ed3\u5e93 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5236\u4f5c\u4e00\u4e2anginx\u7684docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-04T19:30:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T10:12:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d166a37434c4406c01238\/25-0.png\" \/>\n<meta name=\"author\" content=\"\u79d1, \u96c5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u96c5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/\",\"name\":\"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-10-04T19:30:58+00:00\",\"dateModified\":\"2024-04-30T10:12:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\",\"name\":\"\u79d1, \u96c5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u96c5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5236\u4f5c\u4e00\u4e2anginx\u7684docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d","og_description":"\u4f60\u597d\u3002 \u6211\u662fZOZO Technologies\u5f00\u53d1\u90e8\u7684\u6749\u5c71\u3002 \u4e3a\u4e86\u5c06nginx\u7684Docker\u955c\u50cf\u4fdd\u5b58\u5728\u79c1\u6709\u4ed3\u5e93 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5236\u4f5c\u4e00\u4e2anginx\u7684docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-04T19:30:58+00:00","article_modified_time":"2024-04-30T10:12:17+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d166a37434c4406c01238\/25-0.png"}],"author":"\u79d1, \u96c5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u96c5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/","name":"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-10-04T19:30:58+00:00","dateModified":"2024-04-30T10:12:17+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5236\u4f5c\u4e00\u4e2anginx\u7684Docker\u955c\u50cf\uff0c\u5e76\u4fdd\u5b58\u5230\u79c1\u6709\u7684\u4ee3\u7801\u5e93\u4e2d"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a","name":"\u79d1, \u96c5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","caption":"\u79d1, \u96c5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aanginx%e7%9a%84docker%e9%95%9c%e5%83%8f%ef%bc%8c%e5%b9%b6%e4%bf%9d%e5%ad%98%e5%88%b0%e7%a7%81%e6%9c%89%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ba%93%e4%b8%ad%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33161"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33161\/revisions"}],"predecessor-version":[{"id":93482,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33161\/revisions\/93482"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}