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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay