FROM scratch container I am getting this error:
standard_init_linux.go:195: exec user process caused "no such file or directory"
My dockerfile is simple:
FROM scratch ADD main / CMD ["/main"]
main is a go binary. It works just fine with a hello world app, but fails for larger projects.
I built the go binary using these flags:
And I’ve also tried adding
-ldflags '-w -extldflags "-static"'
The binary is building just fine and works in a regular Linux container.
This error message doesn’t give me much of a clue what might be the error. Any ideas what would be causing a file to not be found in such a simple dockerfile?