Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
###
FROM golang:1.14-alpine AS builder

RUN apk add --no-cache upx=3.96-r0

ARG component=${component:-key-retrieval}
ARG branch
ARG revision

ENV GO111MODULE=on
ENV USER=covidshield
ENV UID=10001
ENV GOLDFLAGS="-X github.com/CovidShield/server/pkg/server.branch=${branch} -X github.com/CovidShield/server/pkg/server.revision=${revision}"
ENV GOLDFLAGS="-s -w -X github.com/CovidShield/server/pkg/server.branch=${branch} -X github.com/CovidShield/server/pkg/server.revision=${revision}"

WORKDIR /go/src/github.com/CovidShield/server

Expand All @@ -25,7 +27,7 @@ RUN adduser \

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="${GOLDFLAGS}" -o server ./cmd/${component}
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="${GOLDFLAGS}" -o server ./cmd/${component} && upx server

###
# Step 2 - Build
Expand Down