forked from cyberark/secretless-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (41 loc) · 1.57 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
FROM golang:1.11-stretch as secretless-builder
MAINTAINER Conjur Inc.
LABEL builder="secretless-builder"
WORKDIR /secretless
# TODO: Expand this with build args when we support other arches
ENV GOOS=linux \
GOARCH=amd64 \
CGO_ENABLED=1
COPY go.mod go.sum /secretless/
RUN go mod download
COPY . /secretless
RUN go build -o dist/$GOOS/$GOARCH/secretless-broker ./cmd/secretless-broker && \
go build -o dist/$GOOS/$GOARCH/summon2 ./cmd/summon2
# =================== MAIN CONTAINER ===================
FROM alpine:3.8 as secretless-broker
MAINTAINER CyberArk Software, Inc.
RUN apk add -u shadow libc6-compat && \
# Add Limited user
groupadd -r secretless \
-g 777 && \
useradd -c "secretless runner account" \
-g secretless \
-u 777 \
-m \
-r \
secretless && \
# Ensure plugin dir is owned by secretless user
mkdir -p /usr/local/lib/secretless && \
# Make and setup a directory for sockets at /sock
mkdir /sock && \
# Make and setup a directory for the Conjur client certificate/access token
mkdir -p /etc/conjur/ssl && \
mkdir -p /run/conjur && \
chown secretless:secretless /usr/local/lib/secretless \
/sock \
/etc/conjur/ssl \
/run/conjur
USER secretless
ENTRYPOINT [ "/usr/local/bin/secretless-broker" ]
COPY --from=secretless-builder /secretless/dist/linux/amd64/secretless-broker \
/secretless/dist/linux/amd64/summon2 /usr/local/bin/