diff --git a/Dockerfile b/Dockerfile index 8471cf417..5c16b1824 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,6 +65,7 @@ RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \ #复制文件 COPY --from=builder /etc/ShellCrash /etc/ShellCrash COPY --from=builder /tmp/CrashCore.tar.gz /etc/ShellCrash/CrashCore.tar.gz +RUN cp -a /etc/ShellCrash /etc/ShellCrash_backup COPY --from=builder /etc/profile /etc/profile COPY --from=builder /usr/bin/crash /usr/bin/crash diff --git a/docker/README.md b/docker/README.md index c3daaa645..1e244800d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -88,7 +88,7 @@ mkdir -p /root/ShellCrash ```shell docker run -d \ ……………… - -v shellcrash_configs:/etc/ShellCrash/configs \ + -v shellcrash_configs:/etc/ShellCrash \ ……………… ``` diff --git a/docker/compose.yml b/docker/compose.yml index d246815bf..b8cc9f863 100644 --- a/docker/compose.yml +++ b/docker/compose.yml @@ -17,7 +17,7 @@ services: - net.ipv4.ip_forward: 1 # - net.ipv6.conf.all.forwarding=1 volumes: - - shellcrash_configs:/etc/ShellCrash/configs:rw + - shellcrash_configs:/etc/ShellCrash:rw restart: unless-stopped volumes: diff --git a/docker/s6-rc.d/sc-init/type b/docker/s6-rc.d/sc-init/type new file mode 100644 index 000000000..3d92b15f2 --- /dev/null +++ b/docker/s6-rc.d/sc-init/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/docker/s6-rc.d/sc-init/up b/docker/s6-rc.d/sc-init/up new file mode 100644 index 000000000..c47dec15c --- /dev/null +++ b/docker/s6-rc.d/sc-init/up @@ -0,0 +1,10 @@ +#!/command/execlineb -P +foreground { + if { test ! -d /etc/ShellCrash } + mkdir -p /etc/ShellCrash +} +foreground { + if { sh -c "[ -z \"$(ls -A /etc/ShellCrash 2>/dev/null)\" ]" } + cp -a /etc/ShellCrash_backup/. /etc/ShellCrash/ +} +exit 0 diff --git a/docker/s6-rc.d/user/contents.d/sc-init b/docker/s6-rc.d/user/contents.d/sc-init new file mode 100644 index 000000000..e69de29bb