-
Notifications
You must be signed in to change notification settings - Fork 186
/
Dockerfile
32 lines (26 loc) · 983 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
29
30
31
32
# =============================================================================
# build stage
#
# install golang dependencies & build binaries
# =============================================================================
FROM golang:1.10 AS build
ENV GOFLAGS='-ldflags="-s -w"'
ENV CGO_ENABLED=0
# use gpm to install dependencies
COPY Godeps gpm /tmp/
RUN cd /tmp && ./gpm install
WORKDIR /go/src/github.com/buzzfeed/sso
COPY cmd ./cmd
COPY internal ./internal
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 && rm -rf /var/lib/apt/lists/*
WORKDIR /sso
COPY ./static ./static
COPY --from=build /bin/sso-* /bin/