-
Notifications
You must be signed in to change notification settings - Fork 62
/
Dockerfile
89 lines (65 loc) · 2.8 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#syntax=docker/dockerfile:1
ARG BUILDKIT_SBOM_SCAN_CONTEXT=true
ARG TARGETPLATFORM
ARG UBUNTU_RELEASE
#############################################
# Base layer
#############################################
FROM ubuntu:$UBUNTU_RELEASE AS base-layer
ARG BUILDKIT_SBOM_SCAN_STAGE=true
ARG TARGETPLATFORM
COPY --chown=root:root ["docker-install-base.sh", "/root"]
RUN --mount=type=cache,id=pritunl-apt-lists-${TARGETPLATFORM},target=/var/lib/apt \
--mount=type=cache,id=pritunl-apt-cache-${TARGETPLATFORM},target=/var/cache/apt \
set -ex \
&& bash /root/docker-install-base.sh \
&& rm /root/docker-install-base.sh
#############################################
# MongoDB layer
#############################################
FROM base-layer AS monogodb-layer
ARG BUILDKIT_SBOM_SCAN_STAGE=true
ARG MONGODB_VERSION
ARG TARGETPLATFORM
ENV MONGODB_VERSION=${MONGODB_VERSION}
COPY --chown=root:root ["docker-install-mongo.sh", "/root"]
RUN --mount=type=cache,id=pritunl-apt-lists-${TARGETPLATFORM},target=/var/lib/apt \
--mount=type=cache,id=pritunl-apt-cache-${TARGETPLATFORM},target=/var/cache/apt \
set -ex \
&& bash /root/docker-install-mongo.sh \
&& rm /root/docker-install-mongo.sh
#############################################
# Final/runtime layer
#############################################
FROM monogodb-layer
ARG BUILDKIT_SBOM_SCAN_STAGE=true
ARG PRITUNL_VERSION
ARG TARGETPLATFORM
ENV PRITUNL_VERSION=${PRITUNL_VERSION}
COPY --chown=root:root ["docker-install-pritunl.sh", "/root"]
RUN --mount=type=cache,id=pritunl-apt-lists-${TARGETPLATFORM},target=/var/lib/apt \
--mount=type=cache,id=pritunl-apt-cache-${TARGETPLATFORM},target=/var/cache/apt \
--mount=type=cache,id=pritunl-cache-${TARGETPLATFORM},target=/pritunl/cache \
set -ex \
&& bash /root/docker-install-pritunl.sh \
&& rm /root/docker-install-pritunl.sh
ADD start-pritunl /bin/start-pritunl
EXPOSE 80
EXPOSE 443
EXPOSE 1194
EXPOSE 1194/udp
EXPOSE 1195/udp
EXPOSE 9700/tcp
ENTRYPOINT ["/bin/start-pritunl"]
CMD ["/usr/bin/tail", "-f", "/var/log/pritunl.log", "/var/log/mongodb/mongod.log"]
ARG BUILD_DATE
LABEL org.opencontainers.image.authors="Christian 'Jippi' Winther <[email protected]>"
LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.description="Easy way to run Pritunl on Docker"
LABEL org.opencontainers.image.documentation="https://github.com/jippi/docker-pritunl"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/jippi/docker-pritunl"
LABEL org.opencontainers.image.title="Pritunl on Docker"
LABEL org.opencontainers.image.url="https://github.com/jippi/docker-pritunl"
LABEL org.opencontainers.image.vendor="Christian 'Jippi' Winther <[email protected]>"
LABEL org.opencontainers.image.version=${PRITUNL_VERSION}