ovpn-certman/Dockerfile

26 lines
885 B
Text
Raw Permalink Normal View History

2021-02-06 23:51:36 +01:00
FROM golang:1.15
2018-02-03 18:14:47 +01:00
WORKDIR /go/src/github.com/zom-bi/ovpn-certman
2018-02-03 18:14:47 +01:00
ADD . .
RUN \
go get -tags="dev" -v github.com/zom-bi/ovpn-certman && \
2018-02-03 18:14:47 +01:00
go get github.com/shurcooL/vfsgen/cmd/vfsgendev && \
go generate github.com/zom-bi/ovpn-certman/assets && \
2018-02-03 18:34:56 +01:00
go build -tags="netgo"
2018-02-03 18:14:47 +01:00
FROM scratch
ENV \
OAUTH2_CLIENT_ID="" \
OAUTH2_CLIENT_SECRET="" \
OAUTH2_AUTH_URL="https://gitlab.example.com/oauth/authorize" \
OAUTH2_TOKEN_URL="https://gitlab.example.com/oauth/token" \
OAUTH2_REDIRECT_URL="https://vpn.example.com/login/oauth2/redirect" \
2018-02-03 18:14:47 +01:00
USER_ENDPOINT="https://gitlab.example.com/api/v4/user" \
VPN_DEV="tun" \
VPN_HOST="vpn.example.com" \
VPN_PORT="1194" \
2019-05-15 19:08:24 +02:00
VPN_PROTO="udp"
2018-02-03 19:25:24 +01:00
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2019-05-15 19:08:24 +02:00
COPY --from=0 /go/src/github.com/zom-bi/ovpn-certman/ovpn-certman /certman
2018-02-03 18:14:47 +01:00
ENTRYPOINT ["/certman"]