forked from miku/esbulk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (25 loc) · 968 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
################################
# STEP 1 build executable binary
################################
FROM golang:1.13.4-alpine3.10 AS builder
# https://github.com/moby/moby/issues/34513#issuecomment-389250632, we hope
# this label is not used for something critical in your setup.
LABEL stage=intermediate
# Install git, required for fetching the dependencies.
RUN apk update && apk add --no-cache git make
WORKDIR /app
COPY . .
# Fetch dependencies, using go get, download only, verbose.
RUN go get -d -v
# Build the binary.
RUN make esbulk
############################
# STEP 2 build a small image
############################
FROM scratch
# Copy our static executable.
COPY --from=builder /app/esbulk /app/esbulk
# https://stackoverflow.com/questions/52969195/docker-container-running-golang-http-client-getting-error-certificate-signed-by
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Default command.
ENTRYPOINT ["/app/esbulk"]