forked from cyberark/secretless-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
46 lines (37 loc) · 1.3 KB
/
Dockerfile.dev
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
FROM golang:1.11-stretch
MAINTAINER Conjur Inc.
RUN apt-get update && \
apt-get install -y curl \
jq \
less \
vim
ENV ROOT_DIR=/secretless
WORKDIR $ROOT_DIR
RUN groupadd -r secretless \
-g 777 && \
useradd -c "secretless runner account" \
-g secretless \
-u 777 \
-m \
-r \
secretless && \
mkdir -p /usr/local/lib/secretless \
/sock && \
chown secretless:secretless /usr/local/lib/secretless \
/sock
RUN go get -u github.com/jstemmer/go-junit-report && \
go get github.com/smartystreets/goconvey && \
go get golang.org/x/tools/cmd/goimports
COPY go.mod go.sum /secretless/
RUN go mod download
# TODO: Expand this with build args when we support other arches
ENV GOOS=linux \
GOARCH=amd64 \
CGO_ENABLED=1
COPY . .
# Not strictly needed but we might as well do this step too since
# the dev may want to run the binary
RUN go build -o dist/$GOOS/$GOARCH/secretless-broker ./cmd/secretless-broker && \
go build -o dist/$GOOS/$GOARCH/summon2 ./cmd/summon2 && \
ln -s $ROOT_DIR/dist/$GOOS/$GOARCH/secretless-broker /usr/local/bin/ && \
ln -s $ROOT_DIR/dist/$GOOS/$GOARCH/summon2 /usr/local/bin/