docker: Disable CGO

Isnt needed by our code, and breaks distroless

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-03-17 16:49:04 +05:30
parent 612f0e8977
commit e750fe2cc7
No known key found for this signature in database
GPG Key ID: F93C394FE9BBAFD5
1 changed files with 2 additions and 1 deletions

View File

@ -11,13 +11,14 @@ RUN go mod download
# Build the application
ARG PASTY_VERSION=unset-debug
COPY . .
ENV CGO_ENABLED=0
RUN go build \
-o pasty \
-ldflags "\
-X github.com/lus/pasty/internal/static.Version=$PASTY_VERSION" \
./cmd/pasty/main.go
# Run the application in an empty alpine environment
# Run the application on distroless
FROM gcr.io/distroless/base:latest
WORKDIR /root
COPY --from=build /app/pasty .