forked from louketo/louketo-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (34 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ARG HOMEDIR=/opt/gatekeeper
#
# Builder
#
FROM golang:1.20.8 AS build-env
ARG HOMEDIR
ADD . /src/
WORKDIR /src/
RUN make static
WORKDIR ${HOMEDIR}
RUN cp /src/bin/gatekeeper .
COPY templates ./templates
RUN echo "gatekeeper:x:1000:gatekeeper" >> /etc/group && \
echo "gatekeeper:x:1000:1000:gatekeeper user:${HOMEDIR}:/sbin/nologin" >> /etc/passwd && \
chown -R gatekeeper:gatekeeper ${HOMEDIR} && \
chmod -R g+rw ${HOMEDIR} && \
chmod +x gatekeeper
#
# Actual image
#
FROM scratch
ARG HOMEDIR
LABEL Name=gatekeeper \
Release=https://github.com/gogatekeeper/gatekeeper \
Url=https://github.com/gogatekeeper/gatekeeper \
Help=https://github.com/gogatekeeper/gatekeeper/issues
COPY --chown=1000:1000 --from=build-env ${HOMEDIR} ${HOMEDIR}
COPY --from=build-env /etc/passwd /etc/passwd
COPY --from=build-env /etc/group /etc/group
COPY --from=build-env /usr/share/ca-certificates /usr/share/ca-certificates
COPY --from=build-env /etc/ssl/certs /etc/ssl/certs
WORKDIR ${HOMEDIR}
USER 1000
ENTRYPOINT [ "/opt/gatekeeper/gatekeeper" ]