Reputation: 1401
The following code generates an error: standard_init_linux.go:211: exec user process caused “exec format error”
Any pointers to what I’m doing wrong?
FROM golang:alpine AS builder
ENV GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOARCH=wasm GOOS=js
WORKDIR /build
COPY . .
COPY wasm_exec.js .
COPY server.go .
COPY main.wasm .
COPY manifest.json .
COPY sw.js .
COPY wasm_exec.js .
COPY app.js .
COPY index.html .
EXPOSE 8989
ENTRYPOINT ["./server.go"]
Upvotes: 2
Views: 1697
Reputation: 1196
dos2unix
fix your files' format, which maybe changed by git from lf to crlfENTRYPOINT ["go","run","./server.go"]
Upvotes: 2
Reputation: 174
The error is because you are trying to execute server.go
file without compiling you need to compile server.go
to get the executable which then can be used as executable.
go build server.go
Or you can directly run it using
go run server.go
Upvotes: 1