forked from activecm/rita-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (22 loc) · 1.01 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
FROM golang:1.10-alpine as rita-builder
RUN apk add --no-cache git make ca-certificates wget build-base
RUN wget -q -O /go/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 && chmod +x /go/bin/dep
WORKDIR /go/src/github.com/activecm/rita
COPY . .
# Change ARGs with --build-arg to target other architectures
# Produce a self-contained statically linked binary
ARG CGO_ENABLED=0
# Set the build target architecture and OS
ARG GOARCH=amd64
ARG GOOS=linux
# Passing arguments in to make result in them being set as
# environment variables for the call to go build
RUN make CGO_ENABLED=$CGO_ENABLED GOARCH=$GOARCH GOOS=$GOOS
FROM scratch
# Use WORKDIR to create /var/lib/rita since "mkdir" doesn't exist in scratch
# /var/lib/rita is required for the safebrowsing cache in the default config
WORKDIR /var/lib/rita
WORKDIR /
COPY --from=rita-builder /go/src/github.com/activecm/rita/etc/rita.yaml /etc/rita/config.yaml
COPY --from=rita-builder /go/src/github.com/activecm/rita/rita /rita
ENTRYPOINT ["/rita"]