[root@spray2:~]# kubectl logs -f client-go-in-cluster-demo
standard_init_linux.go:211: exec user process caused "no such file or directory"
.
非常简单的Dockerfile
[root@omp-harbor:/data/Dockerfile/k8stest]# vim Dockerfile
FROM alpine:3.12.3
COPY ./app /app
CMD ["/app"]
.
搞了半天,其实是alpine镜像的问题:
https://stackoverflow.com/a/62123648
.
CGO has to be disabled for alpine
export CGO_ENABLED=0
Then go build
.
All OK啦!!!!
有疑问加站长微信联系(非本文作者)