镜像构建历史
# 2026-03-28 19:33:13 0.00B 设置默认要执行的命令
CMD ["nginx" "-g" "daemon off;"]
# 2026-03-28 19:33:13 0.00B 配置容器启动时运行的命令
ENTRYPOINT ["/docker-entrypoint.sh"]
# 2026-03-28 19:33:13 0.00B 声明容器运行时监听的端口
EXPOSE [80/tcp]
# 2026-03-28 19:33:13 204.00B 执行命令并创建新的镜像层
RUN /bin/sh -c echo '<!DOCTYPE html>' > /usr/share/nginx/html/index.html && echo '<html><head><title>Welcome to nginx!</title></head>' >> /usr/share/nginx/html/index.html && echo '<body><h1>Welcome to nginx!</h1>' >> /usr/share/nginx/html/index.html && echo '<p>If you see this page, the nginx web server is successfully installed and working.</p></body></html>' >> /usr/share/nginx/html/index.html # buildkit
# 2026-03-28 19:33:13 1.85KB 执行命令并创建新的镜像层
RUN /bin/sh -c echo '#!/bin/sh' > /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo '# 生成nginx配置文件' >> /docker-entrypoint.sh && echo 'cat > /etc/nginx/conf.d/default.conf << NGINXCONF' >> /docker-entrypoint.sh && echo 'server {' >> /docker-entrypoint.sh && echo ' listen ${LISTEN_PORT};' >> /docker-entrypoint.sh && echo ' server_name ${SERVER_NAME};' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' location / {' >> /docker-entrypoint.sh && echo ' root ${ROOT_PATH};' >> /docker-entrypoint.sh && echo ' index ${INDEX_FILE};' >> /docker-entrypoint.sh && echo ' try_files \$uri \$uri/ =404;' >> /docker-entrypoint.sh && echo ' }' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' # DYNAMIC_PROXY_LOCATIONS' >> /docker-entrypoint.sh && echo '}' >> /docker-entrypoint.sh && echo 'NGINXCONF' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo '# 处理多个反向代理配置' >> /docker-entrypoint.sh && echo 'i=1' >> /docker-entrypoint.sh && echo 'while true; do' >> /docker-entrypoint.sh && echo ' eval PROXY_URL=\$PROXY_PASS_URL_$i' >> /docker-entrypoint.sh && echo ' eval PROXY_LOC=\$PROXY_LOCATION_$i' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' if [ -z "$PROXY_URL" ]; then' >> /docker-entrypoint.sh && echo ' break' >> /docker-entrypoint.sh && echo ' fi' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' LOC="${PROXY_LOC:-/api/}"' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' # 追加反向代理配置到临时文件' >> /docker-entrypoint.sh && echo ' cat >> /tmp/proxy.conf << PROXYBLOCK' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' location __LOC__ {' >> /docker-entrypoint.sh && echo ' proxy_pass __URL__;' >> /docker-entrypoint.sh && echo ' proxy_set_header Host \$host;' >> /docker-entrypoint.sh && echo ' proxy_set_header X-Real-IP \$remote_addr;' >> /docker-entrypoint.sh && echo ' proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;' >> /docker-entrypoint.sh && echo ' proxy_set_header X-Forwarded-Proto \$scheme;' >> /docker-entrypoint.sh && echo ' proxy_connect_timeout ${PROXY_TIMEOUT}s;' >> /docker-entrypoint.sh && echo ' proxy_send_timeout ${PROXY_TIMEOUT}s;' >> /docker-entrypoint.sh && echo ' proxy_read_timeout ${PROXY_TIMEOUT}s;' >> /docker-entrypoint.sh && echo ' }' >> /docker-entrypoint.sh && echo 'PROXYBLOCK' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' # 替换占位符' >> /docker-entrypoint.sh && echo ' sed -i "s|__LOC__|$LOC|g" /tmp/proxy.conf' >> /docker-entrypoint.sh && echo ' sed -i "s|__URL__|$PROXY_URL|g" /tmp/proxy.conf' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo ' i=$((i + 1))' >> /docker-entrypoint.sh && echo 'done' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo '# 将反向代理配置插入到配置文件中' >> /docker-entrypoint.sh && echo 'if [ -f /tmp/proxy.conf ]; then' >> /docker-entrypoint.sh && echo ' sed -i "/# DYNAMIC_PROXY_LOCATIONS/r /tmp/proxy.conf" /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && echo ' rm -f /tmp/proxy.conf' >> /docker-entrypoint.sh && echo 'fi' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo '# 删除占位符' >> /docker-entrypoint.sh && echo 'sed -i "/# DYNAMIC_PROXY_LOCATIONS/d" /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo '# 替换环境变量(只替换指定的变量,保留nginx变量如$host等)' >> /docker-entrypoint.sh && echo 'envsubst '\''${LISTEN_PORT},${SERVER_NAME},${ROOT_PATH},${INDEX_FILE},${PROXY_TIMEOUT}'\'' < /etc/nginx/conf.d/default.conf > /etc/nginx/conf.d/default.conf.tmp' >> /docker-entrypoint.sh && echo 'mv /etc/nginx/conf.d/default.conf.tmp /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo 'echo "Nginx配置:"' >> /docker-entrypoint.sh && echo 'cat /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && echo '' >> /docker-entrypoint.sh && echo 'exec "$@"' >> /docker-entrypoint.sh && chmod +x /docker-entrypoint.sh # buildkit
# 2026-03-28 19:33:13 0.00B 设置环境变量 LISTEN_PORT SERVER_NAME ROOT_PATH INDEX_FILE PROXY_TIMEOUT
ENV LISTEN_PORT=80 SERVER_NAME=localhost ROOT_PATH=/usr/share/nginx/html INDEX_FILE=index.html PROXY_TIMEOUT=600
# 2026-03-28 19:33:13 4.18MB 执行命令并创建新的镜像层
RUN /bin/sh -c apk add --no-cache gettext # buildkit
# 2026-03-25 07:11:07 49.45MB 执行命令并创建新的镜像层
RUN /bin/sh -c set -x && apkArch="$(cat /etc/apk/arch)" && nginxPackages=" nginx=${NGINX_VERSION}-r${PKG_RELEASE} nginx-module-xslt=${NGINX_VERSION}-r${DYNPKG_RELEASE} nginx-module-geoip=${NGINX_VERSION}-r${DYNPKG_RELEASE} nginx-module-image-filter=${NGINX_VERSION}-r${DYNPKG_RELEASE} nginx-module-njs=${NGINX_VERSION}.${NJS_VERSION}-r${NJS_RELEASE} nginx-module-acme=${NGINX_VERSION}.${ACME_VERSION}-r${PKG_RELEASE} " && apk add --no-cache --virtual .checksum-deps openssl && case "$apkArch" in x86_64|aarch64) apk add -X "https://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" --no-cache $nginxPackages ;; *) set -x && tempDir="$(mktemp -d)" && chown nobody:nobody $tempDir && apk add --no-cache --virtual .build-deps gcc libc-dev make openssl-dev pcre2-dev zlib-dev linux-headers libxslt-dev gd-dev geoip-dev libedit-dev bash alpine-sdk findutils curl cargo clang-libclang && su nobody -s /bin/sh -c " export HOME=${tempDir} && cd ${tempDir} && curl -f -L -O https://github.com/nginx/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz && PKGOSSCHECKSUM=\"9ae89f2f9efefec1c7098bfb8da88da93b1370230989dc3cdf3eb3a8d9bf6b777c9dfff7998ea173317f38a66ebc92f8fabf77f024a596a17d0f8a42dfc74b5a *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" && if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then echo \"pkg-oss tarball checksum verification succeeded!\"; else echo \"pkg-oss tarball checksum verification failed!\"; exit 1; fi && tar xzvf ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz && cd pkg-oss-${NGINX_VERSION}-${PKG_RELEASE} && cd alpine && export BUILDTARGET=\"module-geoip module-image-filter module-njs module-xslt module-acme\" && if [ \"\$(apk --print-arch)\" = \"armhf\" ]; then BUILDTARGET=\"\$( echo \$BUILDTARGET | sed 's,module-acme,,' )\"; fi && make \$BUILDTARGET && apk index --allow-untrusted -o ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz ${tempDir}/packages/alpine/${apkArch}/*.apk && abuild-sign -k ${tempDir}/.abuild/abuild-key.rsa ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz " && cp ${tempDir}/.abuild/abuild-key.rsa.pub /etc/apk/keys/ && apk del --no-network .build-deps && if [ "$apkArch" = "armhf" ]; then nginxPackages="$( echo $nginxPackages | sed 's,nginx-module-acme=.*,,')"; fi && apk add -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages ;; esac && apk del --no-network .checksum-deps && if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi && if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi && apk add --no-cache curl ca-certificates # buildkit
# 2026-03-25 07:11:07 0.00B 设置环境变量 ACME_VERSION
ENV ACME_VERSION=0.3.1
# 2026-03-25 07:11:07 0.00B 设置环境变量 NJS_RELEASE
ENV NJS_RELEASE=1
# 2026-03-25 07:11:07 0.00B 设置环境变量 NJS_VERSION
ENV NJS_VERSION=0.9.6
# 2026-03-25 06:12:12 0.00B 设置默认要执行的命令
CMD ["nginx" "-g" "daemon off;"]
# 2026-03-25 06:12:12 0.00B 设置停止容器时发送的系统调用信号
STOPSIGNAL SIGQUIT
# 2026-03-25 06:12:12 0.00B 声明容器运行时监听的端口
EXPOSE map[80/tcp:{}]
# 2026-03-25 06:12:12 0.00B 配置容器启动时运行的命令
ENTRYPOINT ["/docker-entrypoint.sh"]
# 2026-03-25 06:12:12 4.62KB 复制新文件或目录到容器中
COPY 30-tune-worker-processes.sh /docker-entrypoint.d # buildkit
# 2026-03-25 06:12:12 3.02KB 复制新文件或目录到容器中
COPY 20-envsubst-on-templates.sh /docker-entrypoint.d # buildkit
# 2026-03-25 06:12:12 389.00B 复制新文件或目录到容器中
COPY 15-local-resolvers.envsh /docker-entrypoint.d # buildkit
# 2026-03-25 06:12:12 2.12KB 复制新文件或目录到容器中
COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d # buildkit
# 2026-03-25 06:12:12 1.62KB 复制新文件或目录到容器中
COPY docker-entrypoint.sh / # buildkit
# 2026-03-25 06:12:12 4.28MB 执行命令并创建新的镜像层
RUN /bin/sh -c set -x && addgroup -g 101 -S nginx && adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx && apkArch="$(cat /etc/apk/arch)" && nginxPackages=" nginx=${NGINX_VERSION}-r${PKG_RELEASE} " && apk add --no-cache --virtual .checksum-deps openssl && case "$apkArch" in x86_64|aarch64) set -x && KEY_SHA512="e09fa32f0a0eab2b879ccbbc4d0e4fb9751486eedda75e35fac65802cc9faa266425edf83e261137a2f4d16281ce2c1a5f4502930fe75154723da014214f0655" && wget -O /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub && if echo "$KEY_SHA512 */tmp/nginx_signing.rsa.pub" | sha512sum -c -; then echo "key verification succeeded!"; mv /tmp/nginx_signing.rsa.pub /etc/apk/keys/; else echo "key verification failed!"; exit 1; fi && DEPS=$(apk query --summarize depends --recursive --no-cache --repository "@nginxorg https://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" ${nginxPackages/=/@nginxorg=}) && apk add --no-cache $DEPS && apk add --repositories-file /dev/null -X "https://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" --no-cache $nginxPackages ;; *) set -x && tempDir="$(mktemp -d)" && chown nobody:nobody $tempDir && apk add --no-cache --virtual .build-deps gcc libc-dev make openssl-dev pcre2-dev zlib-dev linux-headers bash alpine-sdk findutils curl && su nobody -s /bin/sh -c " export HOME=${tempDir} && cd ${tempDir} && curl -f -L -O https://github.com/nginx/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz && PKGOSSCHECKSUM=\"9ae89f2f9efefec1c7098bfb8da88da93b1370230989dc3cdf3eb3a8d9bf6b777c9dfff7998ea173317f38a66ebc92f8fabf77f024a596a17d0f8a42dfc74b5a *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" && if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then echo \"pkg-oss tarball checksum verification succeeded!\"; else echo \"pkg-oss tarball checksum verification failed!\"; exit 1; fi && tar xzvf ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz && cd pkg-oss-${NGINX_VERSION}-${PKG_RELEASE} && cd alpine && make base && apk index --allow-untrusted -o ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz ${tempDir}/packages/alpine/${apkArch}/*.apk && abuild-sign -k ${tempDir}/.abuild/abuild-key.rsa ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz " && cp ${tempDir}/.abuild/abuild-key.rsa.pub /etc/apk/keys/ && apk del --no-network .build-deps && DEPS=$(apk query --summarize depends --recursive --no-cache --repository "@nginxorg ${tempDir}/packages/alpine/" ${nginxPackages/=/@nginxorg=}) && apk add --no-cache $DEPS && apk add --repositories-file /dev/null -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages ;; esac && apk del --no-network .checksum-deps && if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi && if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi && apk add --no-cache gettext-envsubst && apk add --no-cache tzdata && ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log && mkdir /docker-entrypoint.d # buildkit
# 2026-03-25 06:12:12 0.00B 设置环境变量 DYNPKG_RELEASE
ENV DYNPKG_RELEASE=1
# 2026-03-25 06:12:12 0.00B 设置环境变量 PKG_RELEASE
ENV PKG_RELEASE=1
# 2026-03-25 06:12:12 0.00B 设置环境变量 NGINX_VERSION
ENV NGINX_VERSION=1.29.7
# 2026-03-25 06:12:12 0.00B 添加元数据标签
LABEL maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>
# 2026-01-28 09:18:04 0.00B 设置默认要执行的命令
CMD ["/bin/sh"]
# 2026-01-28 09:18:04 8.44MB 复制文件或目录到容器中
ADD alpine-minirootfs-3.23.3-x86_64.tar.gz / # buildkit
镜像信息
{
"Id": "sha256:8a65de484eb6e3e2a8fe6c699f422ec3b5ebadb0bd640a78b363caad73041503",
"RepoTags": [
"gogoshine/nginx:latest",
"swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/gogoshine/nginx:latest"
],
"RepoDigests": [
"gogoshine/nginx@sha256:3fa25861455f37c347adfe1cc6993933cde61d0beda8fbb7d7669b7de0cca016",
"swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/gogoshine/nginx@sha256:1c8997b5ea919bba68936981ff352222bba5bd23e329709722b283fdfd412b65"
],
"Parent": "",
"Comment": "buildkit.dockerfile.v0",
"Created": "2026-03-28T11:33:13.788571469Z",
"Container": "",
"ContainerConfig": null,
"DockerVersion": "",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NGINX_VERSION=1.29.7",
"PKG_RELEASE=1",
"DYNPKG_RELEASE=1",
"NJS_VERSION=0.9.6",
"NJS_RELEASE=1",
"ACME_VERSION=0.3.1",
"LISTEN_PORT=80",
"SERVER_NAME=localhost",
"ROOT_PATH=/usr/share/nginx/html",
"INDEX_FILE=index.html",
"PROXY_TIMEOUT=600"
],
"Cmd": [
"nginx",
"-g",
"daemon off;"
],
"ArgsEscaped": true,
"Image": "",
"Volumes": null,
"WorkingDir": "/",
"Entrypoint": [
"/docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {
"maintainer": "NGINX Docker Maintainers \u003cdocker-maint@nginx.com\u003e"
},
"StopSignal": "SIGQUIT"
},
"Architecture": "amd64",
"Os": "linux",
"Size": 66357386,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/25af34b753a7aa7d86fa1add726b0c5906c28531d29c5e92391ff123560a3378/diff:/var/lib/docker/overlay2/a725727f933d0cf597f430533b22cd41ef20e24da261ba94d202d2c7c484e68f/diff:/var/lib/docker/overlay2/08994fc171cd3191e32ffbf9a6b8bfade93c81793f8133dbff17833398b7b9d4/diff:/var/lib/docker/overlay2/567ff04ada817cc19f89ec1457796e05c238206156a69f058527485be8ab6263/diff:/var/lib/docker/overlay2/460c8eacd0d4624ad9f8a6f4d86317857eb3bbb295fcfb553f37373cf3154cda/diff:/var/lib/docker/overlay2/4f8f71c90a6bdd0aa769936f11320adcea035328cac5bf4cf59f7e477e792ee2/diff:/var/lib/docker/overlay2/4bf6957aa5fea300e6c26c7975061e18739b2e0f1c736dc6f728ac189a2dd493/diff:/var/lib/docker/overlay2/8ef9464b64a63d9e272df5a5a9bee755ca687fd56b409c6b6c92e50342844013/diff:/var/lib/docker/overlay2/a8e0014c797dbdd45d5675b48f67e6768938633ac49c2bfb6b9421b2f8c5042f/diff:/var/lib/docker/overlay2/a6fa7914fbcea4c0d1059f56a52dbd203dbc0253fc46c8ebd11f4a914ddddc18/diff",
"MergedDir": "/var/lib/docker/overlay2/5c82c70db43a3892a573992623320af5c12d023eb9ce5dad08f9a6f71652b21e/merged",
"UpperDir": "/var/lib/docker/overlay2/5c82c70db43a3892a573992623320af5c12d023eb9ce5dad08f9a6f71652b21e/diff",
"WorkDir": "/var/lib/docker/overlay2/5c82c70db43a3892a573992623320af5c12d023eb9ce5dad08f9a6f71652b21e/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:989e799e634906e94dc9a5ee2ee26fc92ad260522990f26e707861a5f52bf64e",
"sha256:27fc2bd29afd3c6b3e6f9d20d88a3a3a138addae51c7a5a531f6309240f0c17d",
"sha256:8ca391b8823ca76d48b70a33cd19e15eef8a510b59a1996f3be251b52d329ec7",
"sha256:9ffd725bd2f3b1568a8018d10d4c35fddd14cad794f6ab3a6c898a587279586d",
"sha256:cff742fa7408f5e618a8c5760b39857487587b50c487b47afac0371b1df162b6",
"sha256:1eb65b5fb2a1c51508bff4e740e2ff4450f325aa578abbdeaf272f2691d0a033",
"sha256:e8abceee8fd8bc37335fe801331b26ddfba6e0f3f24ad96fc456615247fb205b",
"sha256:6d895dca2a499d5f74e001fffce50ad78f864ea8c2a5d1f8bf91e0fa8c32f518",
"sha256:68d843d12074d2d5cde4303fd6ab21e168f8f3582bd13408250ab344e7194e0b",
"sha256:b42dcce9c74628404028eb1136fdb7351f8fef19b7c86b14ca7b1f0307147c7d",
"sha256:68e2d1a6881e69dee75550e11409ea930425eff4458674e3190cffcbcb72a173"
]
},
"Metadata": {
"LastTagTime": "2026-06-17T09:48:20.582110404+08:00"
}
}