# 运行 go mod tidy 来清理依赖项 RUN git config --global credential.helper 'store --file=/root/.git-credentials' && \ go env -w GOPRIVATE=git.ouryun.cn,192.168.20.12 && \ go env -w GONOSUMDB=git.ouryun.cn,192.168.20.12 && \ go env -w GONOPROXY=git.ouryun.cn,192.168.20.12 && \ go env -w GOINSECURE=git.ouryun.cn,192.168.20.12 && \ go env -w GOPROXY="https://goproxy.cn|https://goproxy.io|direct" && \ go mod tidy -x
RUN sed -i 's@archive.ubuntu.com@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list && \ sed -i 's@security.ubuntu.com@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list
# 修复 systemd 服务文件中的 ExecStart 路径 RUNfor service_file in /lib/systemd/system/*.service; do \ if [ -f "$service_file" ]; then \ sed -i 's|^ExecStart=system|ExecStart=/bin/system|g'"$service_file"; \ sed -i 's|^ExecStart=journalctl|ExecStart=/bin/journalctl|g'"$service_file"; \ sed -i 's|^ExecStart=bootctl|ExecStart=/bin/bootctl|g'"$service_file"; \ sed -i 's|^ExecStop=journalctl|ExecStop=/bin/journalctl|g'"$service_file"; \ if ! grep -q '\[Service\]'"$service_file"; then \ echo"Removing $service_file due to missing [Service] section"; \ rm"$service_file"; \ fi; \ fi; \ done