-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
################################ | ||
# STEP 1 build executable binary | ||
################################ | ||
FROM golang:1.12.5-alpine3.9 AS builder | ||
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"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters