Skip to content

Commit 8fe47ad

Browse files
Tinywanclaude
andcommitted
使用 S6 Overlay v3 作为 init 系统
- 添加 S6_OVERLAY_VERSION 构建参数 - 更新镜像描述 - 安装 S6 Overlay v3 (noarch + x86_64) - 设置 /init 为入口点 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f865a6f commit 8fe47ad

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM php:8.4.16-cli-alpine
2+
ARG S6_OVERLAY_VERSION=3.2.1.0
23

34
LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
4-
Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux."
5+
Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux with S6 Overlay."
56

67
# Use Alibaba Cloud mirror for faster downloads
78
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
@@ -34,8 +35,16 @@ COPY config/php.ini /usr/local/etc/php/conf.d/zzz_custom.ini
3435
# Setup document root
3536
RUN mkdir -p /app
3637

38+
# Use S6 Overlay as init system with environment to override services
39+
VOLUME /app
3740
WORKDIR /app
3841
EXPOSE 8787
3942

40-
# Start webman directly
41-
CMD ["php", "start.php", "start"]
43+
CMD ["php", "start.php","start"]
44+
45+
# Install S6 Overlay v3
46+
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
47+
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
48+
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
49+
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
50+
ENTRYPOINT ["/init"]

0 commit comments

Comments
 (0)