我在 Gitlab CI 上运行容器时遇到此错误ERROR: Job failed (system failure): Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "sh": executable file not found in $PATH: unknown (exec.go:57:0s)我。泊坞文件FROM golang:1.16-alpine AS builderENV \ OUTDIR='/out' \ GO111MODULE='on' WORKDIR /appCOPY go.mod /app/COPY go.sum /app/RUN go mod downloadCOPY . /app/RUN CGO_ENABLED=0 GOBIN=${OUTDIR}/usr/bin/ go install .FROM scratchCOPY --from=builder /out/ /ENTRYPOINT ["/usr/bin/app-cli"]My .gitlab-ci.ymlstages: - validationvalidation: image: name: gitlab.mycompany.net:4567/myteam/app-cli:latest entrypoint: [""] stage: validation rules: - if: '$CI_MERGE_REQUEST_IID' script: - ls此错误是否与我的泊坞站文件或 gitlab ci 有关?我可以在本地运行这个,但不能在gitlab运行者docker run --rm -ti gitlab.mycompany.net:4567/myteam/app-cli:latest
3 回答
杨__羊羊
TA贡献1943条经验 获得超7个赞
Giving an empty entrypoint
和不是一回事。not giving the entrypoint at all
在命令中,您没有给出任何入口点。因此,docker 映像使用默认入口点 运行。docker run
ENTRYPOINT ["/usr/bin/app-cli"]
在 中,您将用空的入口点覆盖默认入口点,其中 .gitlab-ci
entrypoint: [""]
executable file not found
试试这个:
validation: image: name: gitlab.mycompany.net:4567/myteam/app-cli:latest entrypoint: ["/usr/bin/app-cli"]
- 3 回答
- 0 关注
- 219 浏览
添加回答
举报
0/150
提交
取消