diff --git a/Dockerfile b/Dockerfile index 392ca53..a50aa6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -FROM golang:1.17-alpine as builder +FROM golang:1.17.1-bullseye as builder COPY . /app WORKDIR /app -RUN apk add git make build-base \ +RUN apt-get update \ + && apt-get install --yes git build-essential \ && make dist FROM gcr.io/distroless/base-debian10 diff --git a/Makefile b/Makefile index 5dd310f..17e406d 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ build: lint $(BIN) .PHONY: dist dist: $(TARGET_DIR) $(SRC) - $(GOBUILD) -o=$(BIN) -a -ldflags "-linkmode external -extldflags -static" + $(GOBUILD) -o=$(BIN) -a -trimpath -ldflags="-extldflags=-static" # docker: build the docker image