diff --git a/Dockerfile b/Dockerfile index 519463d..3f1001b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,15 @@ # https://hub.docker.com/_/golang FROM golang:1.19 as builder +# https://stackoverflow.com/questions/36279253/go-compiled-binary-wont-run-in-an-alpine-docker-container-on-ubuntu-host +ENV CGO_ENABLED=0 + # Set the current working directory inside the container. WORKDIR /go/src/github.com/score-spec/score-compose # Copy the entire project and build it. COPY . . -RUN go build -o /usr/local/bin/score-compose ./cmd/score-compose +RUN GOOS=linux GOARCH=amd64 go build -o /usr/local/bin/score-compose ./cmd/score-compose # Use the official Alpine image for a lean production container. # https://hub.docker.com/_/alpine