The very basic web app is created in Go
package main
import(
"fmt"
"net/http"
"os"
)
func hostHandler(w http.Response
In my case CGO_ENABLED=0 was the key to fix this problem.
Cgo allows to use inline C code in Go sources, see more: https://golang.org/cmd/cgo/
I reckon by default Cgo links your application dynamically to libc, even if you don't use any inline C.
And libc is missing when you package your application to Docker image FROM scratch
Here is my working Dockerfile:
FROM golang:1.9.2-alpine AS builder
WORKDIR /go/src/app
COPY . .
RUN CGO_ENABLED=0 go install
FROM scratch
WORKDIR /opt
COPY --from=builder /go/bin/app .
ENTRYPOINT ["/opt/app"]