forked from activecm/rita-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (22 loc) · 835 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
FROM golang:1.14-alpine as rita-builder
RUN apk add --no-cache git make ca-certificates wget build-base
WORKDIR /go/src/github.com/activecm/rita
# cache dependencies
COPY go.mod go.sum ./
RUN go mod download
# copy the rest of the code
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
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"]