Skip to content

Commit

Permalink
[UPDATE] 修复 Spring Runner 镜像在 Kubernetes 集群时对文件授权失败的问题
Browse files Browse the repository at this point in the history
由于 /workspace/config 目录是以只读卷的方式挂载,导致 chown 时会报 Read-only file system 错误

Signed-off-by: Alan Yeh <[email protected]>
  • Loading branch information
alan-yeh committed Dec 8, 2023
1 parent 0ed1a2f commit 56f9a69
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spring-runner/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /workspace

# 下载 gosu
RUN apt-get update;
RUN apt-get install -y --no-install-recommends ca-certificates wget;
RUN apt-get install -y --no-install-recommends ca-certificates wget nano vim;
RUN wget -O ./gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${TARGETARCH}";

# 添加 entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion spring-runner/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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 && \
apt-get install -y --no-install-recommends tzdata ca-certificates curl telnet iputils-ping nano vim && \
rm -rf /var/lib/apt/lists/*

# 复制启动可执行文件要用到的辅助工具
Expand Down
4 changes: 3 additions & 1 deletion spring-runner/entrypoint-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ fi
#===========================================================================================
# Grant Permissions
#===========================================================================================
chown -R runner:runner .
set +o errexit
find . \! -user runner -exec chown runner '{}' +
set -o errexit

#===========================================================================================
# Build JAVA Options
Expand Down
4 changes: 3 additions & 1 deletion spring-runner/entrypoint-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ fi
#===========================================================================================
# Grant Permissions
#===========================================================================================
chown -R runner:runner .
set +o errexit
find . \! -user runner -exec chown runner '{}' +
set -o errexit

#===========================================================================================
# Build JAVA Options
Expand Down

0 comments on commit 56f9a69

Please sign in to comment.