mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 02:16:28 +02:00
45 lines
1.5 KiB
Docker
45 lines
1.5 KiB
Docker
FROM node:16@sha256:68e34cfcd8276ad531b12b3454af5c24cd028752dfccacce4e19efef6f7cdbe0 as ui
|
|
WORKDIR /build
|
|
|
|
COPY .git ./.git
|
|
COPY Makefile ./Makefile
|
|
|
|
# download yarn dependencies
|
|
COPY ui/yarn.lock ./ui/yarn.lock
|
|
COPY ui/package.json ./ui/package.json
|
|
RUN make yarn
|
|
|
|
# build ui
|
|
COPY ./ui/ ./ui/
|
|
RUN make build-ui
|
|
|
|
FROM golang:1.18-buster@sha256:a66be0e47d87a1f0626aa8ab7f550d607091e52266fb14a3776615f6fa82d186 as build
|
|
WORKDIR /go/src/github.com/pomerium/pomerium
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y --no-install-recommends install zip
|
|
|
|
# cache depedency downloads
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
COPY --from=ui /build/ui/dist ./ui/dist
|
|
|
|
# build
|
|
RUN make build-go NAME=pomerium
|
|
RUN touch /config.yaml
|
|
|
|
# build our own root trust store from current stable
|
|
FROM debian:stable@sha256:1c3446475ac28a9f42a4627d8945d7bed88b8128b5850b61c5890ff47f317681 as casource
|
|
RUN apt-get update && apt-get install -y ca-certificates
|
|
# Remove expired root (https://github.com/pomerium/pomerium/issues/2653)
|
|
RUN rm /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt && update-ca-certificates
|
|
|
|
FROM gcr.io/distroless/base:debug@sha256:d6db59952a608d2f5696f40f3cb4c97d607d6eec59a5f95f7a9ef189734c2062
|
|
ENV AUTOCERT_DIR /data/autocert
|
|
WORKDIR /pomerium
|
|
COPY --from=build /go/src/github.com/pomerium/pomerium/bin/* /bin/
|
|
COPY --from=build /config.yaml /pomerium/config.yaml
|
|
COPY --from=casource /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
ENTRYPOINT [ "/bin/pomerium" ]
|
|
CMD ["-config","/pomerium/config.yaml"]
|