Go-micro: `standard_init_linux.go:175: exec user process caused "no such file or directory"` error on running the server example docker container

Created on 8 Oct 2016  路  1Comment  路  Source: asim/go-micro

I am trying to build the server example docker container. the binary gets successfully built and runs correctly on the machine. but when i run the docker image
this error shows
standard_init_linux.go:175: exec user process caused "no such file or directory"

my docker version is

Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:22:43 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:22:43 2016
 OS/Arch:      linux/amd64

Most helpful comment

How are you compiling the binary? It's like its not being statically linked. Also probably a good idea to use an alpine image rather than scratch. I've updated the Dockerfile.

# Build binary with the following command
# CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./main.go
FROM alpine:3.2
ADD server /
ENTRYPOINT [ "/server" ]

Update: Maybe google the issue as well considering its a Docker issue rather than go-micro related. First link found just copy and pasting your error message https://forums.docker.com/t/standard-init-linux-go-175-exec-user-process-caused-no-such-file/20025/8

>All comments

How are you compiling the binary? It's like its not being statically linked. Also probably a good idea to use an alpine image rather than scratch. I've updated the Dockerfile.

# Build binary with the following command
# CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./main.go
FROM alpine:3.2
ADD server /
ENTRYPOINT [ "/server" ]

Update: Maybe google the issue as well considering its a Docker issue rather than go-micro related. First link found just copy and pasting your error message https://forums.docker.com/t/standard-init-linux-go-175-exec-user-process-caused-no-such-file/20025/8

Was this page helpful?
0 / 5 - 0 ratings