standard_init_linux.go:190: exec user process caused “no such file or directory” Docker with go basic web app

前端 未结 5 2016
野性不改
野性不改 2020-12-21 07:32

The very basic web app is created in Go

package main

import(
   "fmt"
   "net/http"
   "os"
)

func hostHandler(w http.Response         


        
5条回答
  •  暖寄归人
    2020-12-21 08:01

    In my case en env was not enough: RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64

    I had to add as well in the build the tags and ldflags: RUN go build -a -tags netgo -ldflags '-w' -o /go/bin/myService *.go

提交回复
热议问题