-
Notifications
You must be signed in to change notification settings - Fork 186
/
Dockerfile
28 lines (24 loc) · 932 Bytes
/
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
# =============================================================================
# build stage
#
# install golang dependencies & build binaries
# =============================================================================
FROM golang:1.12 AS build
ENV GOFLAGS='-ldflags=-s -ldflags=-w'
ENV CGO_ENABLED=0
ENV GO111MODULE=on
WORKDIR /go/src/github.com/buzzfeed/sso
COPY . .
RUN cd cmd/sso-auth && go build -o /bin/sso-auth
RUN cd cmd/sso-proxy && go build -o /bin/sso-proxy
# =============================================================================
# final stage
#
# add static assets and copy binaries from build stage
# =============================================================================
FROM debian:stable-slim
RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/* \
&& groupadd -r sso && useradd -r -g sso sso
WORKDIR /sso
COPY --from=build /bin/sso-* /bin/
USER sso