dockerfile构建增加python3的安装

This commit is contained in:
somunslotus 2025-10-30 09:00:25 +08:00
parent 6cba7411d1
commit 536aa69fab
3 changed files with 9 additions and 18 deletions

View File

@ -1,19 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="Always" serverName="172.20.32.186" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
<component name="PublishConfigData" autoUpload="Always" serverName="186" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
<option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="172.20.32.186">
<paths name="186">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="remtoe-task-dev">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
<mapping deploy="/home/somuns/remote-task-excutor-cli" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>

View File

@ -30,21 +30,19 @@ WORKDIR /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk update \
&& apk add python3 py3-pip \
&& apk add python3 py3-pip
# 从构建阶段复制可执行文件
COPY --from=builder /app/remote-task-executor-cli /app/
COPY --from-builer /app/merge_aim.py /app/
COPY --from=builder /app/merge_aim.py /app/
# 设置执行权限
RUN chmod a+x /app/remote-task-executor-cli && chmod a+x /app/merge_aim.py
# 设置非 root 用户
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
#RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# 健康检查
HEALTHCHECK --interval=30s --timeout=3s \
CMD /app/remote-task-executor-cli healthcheck || exit 1
# 入口点
ENTRYPOINT ["/app/remote-task-executor-cli", "train"]

View File

@ -7,9 +7,9 @@ import (
)
func main() {
os.Setenv("HTTP_PROXY", "http://172.20.32.233:3128")
os.Setenv("HTTPS_PROXY", "http://172.20.32.233:3128")
os.Setenv("NO_PROXY", "172.20.32.0/24")
//os.Setenv("HTTP_PROXY", "http://172.20.32.233:3128")
//os.Setenv("HTTPS_PROXY", "http://172.20.32.233:3128")
//os.Setenv("NO_PROXY", "172.20.32.0/24")
fmt.Println("===== Environment Variables =====")
fmt.Printf("HTTP_PROXY: %s\n", os.Getenv("HTTP_PROXY"))
fmt.Printf("HTTPS_PROXY: %s\n", os.Getenv("HTTPS_PROXY"))