Skip to content

Commit

Permalink
[UPDATE] 更新 Spring Runner 镜像,使用 tini 启动 java 进程
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Yeh <[email protected]>
  • Loading branch information
alan-yeh committed Sep 11, 2024
1 parent 265c4f5 commit 1776728
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spring-runner/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM image

# 安装时区
ENV TZ=Asia/Shanghai
RUN apk add --no-cache tzdata curl busybox-extras
RUN apk add --no-cache tzdata curl busybox-extras tini

# 复制启动可执行文件要用到的辅助工具
COPY --from=builder /workspace/gosu /usr/local/bin/gosu
Expand Down
2 changes: 1 addition & 1 deletion spring-runner/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FROM image
# 安装时区
ENV TZ=Asia/Shanghai
RUN apt-get update && \
apt-get install -y --no-install-recommends tzdata ca-certificates curl telnet iputils-ping nano vim && \
apt-get install -y --no-install-recommends tzdata ca-certificates curl telnet iputils-ping nano vim tini && \
rm -rf /var/lib/apt/lists/*

# 复制启动可执行文件要用到的辅助工具
Expand Down
4 changes: 2 additions & 2 deletions spring-runner/entrypoint-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SPRING_OPTS="-Dspring.config.additional-location=optional:./config/"
#===========================================================================================
if [ "$1" == "java" ]; then
# 运行开发人员指定的程序
exec gosu runner "$@"
exec gosu runner tini -- "$@"
else
exec gosu runner java "$JAVA_OPTS" "$SPRING_OPTS" "$@" -jar "$RUNNER_EXECUTABLE"
exec gosu runner tini -- java "$JAVA_OPTS" "$SPRING_OPTS" "$@" -jar "$RUNNER_EXECUTABLE"
fi
4 changes: 2 additions & 2 deletions spring-runner/entrypoint-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SPRING_OPTS="-Dspring.config.additional-location=optional:./config/"
#===========================================================================================
if [ "$1" == "java" ]; then
# 运行开发人员指定的程序
exec gosu runner "$@"
exec gosu runner tini -- "$@"
else
exec gosu runner java "$JAVA_OPTS" "$SPRING_OPTS" "$@" -jar "$RUNNER_EXECUTABLE"
exec gosu runner tini -- java "$JAVA_OPTS" "$SPRING_OPTS" "$@" -jar "$RUNNER_EXECUTABLE"
fi

0 comments on commit 1776728

Please sign in to comment.