-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (23 loc) · 884 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
33
34
35
36
37
# Dockerfile References: https://docs.docker.com/engine/reference/builder/
# Start from golang v1.11 base image
FROM golang:1.11 as builder
# Add Maintainer Info
LABEL maintainer="Maximiliano <[email protected]>"
# Set the Current Working Directory inside the container
WORKDIR /go/src/github.com/dockerpedia/annotator
# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .
# Download dependencies
RUN go get -d -v ./...
# Build the Go app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/annotator .
######## Start a new stage from scratch #######
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy the Pre-built binary file from the previous stage
COPY --from=builder /go/bin/annotator .
# Copy configuration
COPY config.toml .
EXPOSE 8081
CMD ["./annotator"]