镜像构建历史
# 2023-12-08 19:47:00 0.00B 设置默认要执行的命令
CMD ["postgres"]
# 2023-12-08 19:47:00 0.00B 声明容器运行时监听的端口
EXPOSE map[5432/tcp:{}]
# 2023-12-08 19:47:00 0.00B 设置停止容器时发送的系统调用信号
STOPSIGNAL SIGINT
# 2023-12-08 19:47:00 0.00B 配置容器启动时运行的命令
ENTRYPOINT ["docker-entrypoint.sh"]
# 2023-12-08 19:47:00 12.49KB 复制新文件或目录到容器中
COPY docker-entrypoint.sh /usr/local/bin/ # buildkit
# 2023-12-08 19:47:00 0.00B 创建挂载点用于持久化数据或共享数据
VOLUME [/var/lib/postgresql/data]
# 2023-12-08 19:47:00 0.00B 执行命令并创建新的镜像层
RUN /bin/sh -c mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 1777 "$PGDATA" # buildkit
# 2023-12-08 19:47:00 0.00B 设置环境变量 PGDATA
ENV PGDATA=/var/lib/postgresql/data
# 2023-12-08 19:47:00 0.00B 执行命令并创建新的镜像层
RUN /bin/sh -c mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 3777 /var/run/postgresql # buildkit
# 2023-12-08 19:47:00 47.88KB 执行命令并创建新的镜像层
RUN /bin/sh -c set -eux; cp -v /usr/local/share/postgresql/postgresql.conf.sample /usr/local/share/postgresql/postgresql.conf.sample.orig; sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample; grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.sample # buildkit
# 2023-12-08 19:47:00 224.46MB 执行命令并创建新的镜像层
RUN /bin/sh -c set -eux; wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2"; echo "$PG_SHA256 *postgresql.tar.bz2" | sha256sum -c -; mkdir -p /usr/src/postgresql; tar --extract --file postgresql.tar.bz2 --directory /usr/src/postgresql --strip-components 1 ; rm postgresql.tar.bz2; apk add --no-cache --virtual .build-deps $DOCKER_PG_LLVM_DEPS bison coreutils dpkg-dev dpkg flex g++ gcc krb5-dev libc-dev libedit-dev libxml2-dev libxslt-dev linux-headers make openldap-dev openssl-dev perl-dev perl-ipc-run perl-utils python3-dev tcl-dev util-linux-dev zlib-dev icu-dev ; cd /usr/src/postgresql; awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new; grep '/var/run/postgresql' src/include/pg_config_manual.h.new; mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; export LLVM_CONFIG="/usr/lib/llvm15/bin/llvm-config"; export CLANG=clang-15; ./configure --enable-option-checking=fatal --build="$gnuArch" --enable-integer-datetimes --enable-thread-safety --enable-tap-tests --disable-rpath --with-uuid=e2fs --with-gnu-ld --with-pgport=5432 --with-system-tzdata=/usr/share/zoneinfo --prefix=/usr/local --with-includes=/usr/local/include --with-libraries=/usr/local/lib --with-gssapi --with-ldap --with-tcl --with-perl --with-python --with-openssl --with-libxml --with-libxslt --with-icu --with-llvm ; make -j "$(nproc)" world; make install-world; make -C contrib install; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' | grep -v -e perl -e python -e tcl )"; apk add --no-cache --virtual .postgresql-rundeps $runDeps bash su-exec tzdata zstd icu-data-full $([ "$(apk --print-arch)" != 'ppc64le' ] && echo 'nss_wrapper') ; apk del --no-network .build-deps; cd /; rm -rf /usr/src/postgresql /usr/local/share/doc /usr/local/share/man ; echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"postgres-sbom","packages":[{"name":"postgres","versionInfo":"11.22","SPDXID":"SPDXRef-Package--postgres","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/postgres@11.22?os_name=alpine&os_version=3.19"}],"licenseDeclared":"PostgreSQL"}]}' > /usr/local/postgres.spdx.json ; postgres --version # buildkit
# 2023-12-08 19:47:00 0.00B 设置环境变量 DOCKER_PG_LLVM_DEPS
ENV DOCKER_PG_LLVM_DEPS=llvm15-dev clang15
# 2023-12-08 19:47:00 0.00B 设置环境变量 PG_SHA256
ENV PG_SHA256=2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0
# 2023-12-08 19:47:00 0.00B 设置环境变量 PG_VERSION
ENV PG_VERSION=11.22
# 2023-12-08 19:47:00 0.00B 设置环境变量 PG_MAJOR
ENV PG_MAJOR=11
# 2023-12-08 19:47:00 0.00B 执行命令并创建新的镜像层
RUN /bin/sh -c mkdir /docker-entrypoint-initdb.d # buildkit
# 2023-12-08 19:47:00 0.00B 设置环境变量 LANG
ENV LANG=en_US.utf8
# 2023-12-08 19:47:00 4.71KB 执行命令并创建新的镜像层
RUN /bin/sh -c set -eux; addgroup -g 70 -S postgres; adduser -u 70 -S -D -G postgres -H -h /var/lib/postgresql -s /bin/sh postgres; mkdir -p /var/lib/postgresql; chown -R postgres:postgres /var/lib/postgresql # buildkit
# 2023-12-08 09:20:49 0.00B
/bin/sh -c #(nop) CMD ["/bin/sh"]
# 2023-12-08 09:20:49 7.38MB
/bin/sh -c #(nop) ADD file:1f4eb46669b5b6275af19eb7471a6899a61c276aa7d925b8ae99310b14b75b92 in /
镜像信息
{
"Id": "sha256:10d7fb41183afb2f06353ad0c08361a8af768a0c73bb6296018d3959792cf8b7",
"RepoTags": [
"postgres:11.22-alpine",
"swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/postgres:11.22-alpine"
],
"RepoDigests": [
"postgres@sha256:33a78858869c44785eee197a60cf281c5c80376bb725992f092ec5e7e072f3de",
"swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/postgres@sha256:88b590ab6ab4bf3f5f9186098df8f8cf174e4f8dfc3866c404595104a8981e6b"
],
"Parent": "",
"Comment": "buildkit.dockerfile.v0",
"Created": "2023-12-08T11:47:00Z",
"Container": "",
"ContainerConfig": null,
"DockerVersion": "",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"5432/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=en_US.utf8",
"PG_MAJOR=11",
"PG_VERSION=11.22",
"PG_SHA256=2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0",
"DOCKER_PG_LLVM_DEPS=llvm15-dev \t\tclang15",
"PGDATA=/var/lib/postgresql/data"
],
"Cmd": [
"postgres"
],
"ArgsEscaped": true,
"Image": "",
"Volumes": {
"/var/lib/postgresql/data": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": null,
"StopSignal": "SIGINT"
},
"Architecture": "amd64",
"Os": "linux",
"Size": 231904749,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/3f1df2346a66ef81469d25c200665386f954f037d8e793bfce8226b90d4d1a18/diff:/var/lib/docker/overlay2/76851445894edcb86c2a27dca06e9cd8ea0f76497a21b9c3a97817d8c1d507be/diff:/var/lib/docker/overlay2/17dae15be3281dd2d693012c4b00ade8e644be914e8e82252aee679d4e23c16b/diff:/var/lib/docker/overlay2/595f8fa9593bff8012b8af6c6cce24826e22d2e5a5e7cfe5a1a1f9f7cad0ecb0/diff:/var/lib/docker/overlay2/f0aaddc16ae1ce7b7364b8b09760b45ec7d794abdd0f1bc42845c74743900c20/diff:/var/lib/docker/overlay2/28b9b51fb777d87abf0cf25aeb3ba4caceab35e72de39179bcac155b11dd5603/diff:/var/lib/docker/overlay2/0ea1628471660d54bef1a105756fbd802d22de1e33f38070ceea4b9ca7012e59/diff",
"MergedDir": "/var/lib/docker/overlay2/98bd188b879e46eafa223801c50ab6ac51e44463f6880a1f3b4a77ae21572a69/merged",
"UpperDir": "/var/lib/docker/overlay2/98bd188b879e46eafa223801c50ab6ac51e44463f6880a1f3b4a77ae21572a69/diff",
"WorkDir": "/var/lib/docker/overlay2/98bd188b879e46eafa223801c50ab6ac51e44463f6880a1f3b4a77ae21572a69/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:5af4f8f59b764c64c6def53f52ada809fe38d528441d08d01c206dfb3fc3b691",
"sha256:1611b15490c46fb195d34d3f0533e7e167ae231051f5cf16007b6d6e4023457d",
"sha256:39cad4609538e9526abddbf9618660986fa341465f7aec0e6759a8f68ba159d5",
"sha256:857b38534af025fc670d5390b682f06343635ac73c11e851a2d29c1b4277fe3e",
"sha256:b226ddbaec7cae3680219599c4e7d9ec375019d90588c296c69bd95a45ba2f05",
"sha256:3cac85236d71b3ba875d0d71a384444eae91115e1667a7ea5eda33097a6a6666",
"sha256:c93ed22b8b036e4e10261ac3c571c79ad3be598b2f7894470fe3dfc6bc424f59",
"sha256:8c72d6a5d76c6d5c43caf0d0ada7879a110cd4a9a84e1465bc1b43bedb478372"
]
},
"Metadata": {
"LastTagTime": "2025-03-20T17:24:28.153424948+08:00"
}
}