2018-09-20 14:26:33 +00:00
|
|
|
FROM golang:alpine as builder
|
2018-01-28 17:43:58 +00:00
|
|
|
|
|
|
|
ADD . /go/src/github.com/Luzifer/nginx-sso
|
|
|
|
WORKDIR /go/src/github.com/Luzifer/nginx-sso
|
|
|
|
|
2019-02-21 23:41:36 +00:00
|
|
|
ENV CGO_ENABLED=1
|
2019-02-21 23:12:23 +00:00
|
|
|
|
2018-01-28 17:43:58 +00:00
|
|
|
RUN set -ex \
|
2019-02-21 23:41:36 +00:00
|
|
|
&& apk add --update \
|
|
|
|
build-base \
|
|
|
|
git \
|
2019-11-03 17:50:44 +00:00
|
|
|
&& go install \
|
|
|
|
-ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" \
|
|
|
|
-mod=vendor
|
2018-09-20 14:26:33 +00:00
|
|
|
|
|
|
|
FROM alpine:3.8
|
|
|
|
|
|
|
|
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
&& apk --no-cache add \
|
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
2018-01-28 17:43:58 +00:00
|
|
|
&& curl -sSfLo /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 \
|
|
|
|
&& chmod +x /usr/local/bin/dumb-init \
|
2018-09-20 14:26:33 +00:00
|
|
|
&& apk --no-cache del --purge \
|
|
|
|
curl
|
2018-01-28 17:43:58 +00:00
|
|
|
|
2018-09-20 14:26:33 +00:00
|
|
|
COPY --from=builder /go/bin/nginx-sso /usr/local/bin/
|
|
|
|
COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/config.yaml /usr/local/share/nginx-sso/
|
|
|
|
COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/docker-start.sh /usr/local/bin/
|
|
|
|
COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/frontend/* /usr/local/share/nginx-sso/frontend/
|
2018-01-28 17:43:58 +00:00
|
|
|
|
2018-09-20 14:26:33 +00:00
|
|
|
EXPOSE 8082
|
2018-01-28 17:43:58 +00:00
|
|
|
VOLUME ["/data"]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-start.sh"]
|
|
|
|
CMD ["--"]
|
2018-09-20 14:26:33 +00:00
|
|
|
|
|
|
|
# vim: set ft=Dockerfile:
|