From b6ce1997c2336db574a5a1f3c3d1ebb7011b6491 Mon Sep 17 00:00:00 2001 From: Nils Balkow-Tychsen Date: Wed, 14 Dec 2022 14:25:15 +0100 Subject: [PATCH] go dependencies in alpine (#23) --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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