diff --git a/stx-oidc-client/debian/docker/Dockerfile b/stx-oidc-client/debian/docker/Dockerfile index 1f874d1..c155c1e 100644 --- a/stx-oidc-client/debian/docker/Dockerfile +++ b/stx-oidc-client/debian/docker/Dockerfile @@ -1,8 +1,18 @@ -FROM golang:latest +FROM golang:latest as builder WORKDIR /app ADD . /app/ RUN go mod download -RUN go build -o stx-oidc-client . + +ENV CGO_ENABLED=0 +RUN go build --ldflags '-extldflags "-static"' -o stx-oidc-client . + +RUN go version > go.version.txt +RUN find /go -type f > go.dl.txt + +FROM scratch + +WORKDIR /app +COPY --from=builder /app ./ EXPOSE 5555 CMD ["./stx-oidc-client"]