DEV Community

Dominik Liebler
Dominik Liebler

Posted on • Originally published at domnikl.github.io on

Docker - Standard_init_linux.go:187 exec user process caused no such file or directory

I have been working a lot with Docker and Go lately and I come across a very annoying error when running tools built in Go in containers on a RaspberryPi. All of the bug reports I found had something to do with Windows-style line endings (CRLF) but I am using MacOS, so this can’t be the solution (at least) for me here.

This is the Dockerfile I have been using:

FROM alpine
WORKDIR /app
ADD washing-machine /app/washing-machine
CMD ["./washing-machine"]

Enter fullscreen mode Exit fullscreen mode

Turns out building the binary on the mac doesn’t work, even using GOOS and GOARCH didn’t do the trick, so I now build the binary in the container, using the golang image from Docker hub:

FROM golang:1.9.3-alpine3.7
ADD . /app
WORKDIR /app
RUN cd /app && \
    apk update && \
    apk add git bash && \
    go get github.com/domnikl/ifttt-webhook && \
    go get github.com/domnikl/fritz-box && \
    go build -o washing-machine
CMD ["/app/washing-machine"]

Enter fullscreen mode Exit fullscreen mode

Hope this will help you in getting around this annoying error message.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs