-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from sendgrid/smaller-image
Reduce Docker image size #patch
- Loading branch information
Showing
2 changed files
with
16 additions
and
23 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 |
---|---|---|
@@ -1,34 +1,20 @@ | ||
ARG GO_VERSION=1.12 | ||
ARG GO_VERSION=1.12.1 | ||
|
||
# The build stage is used for building the aws-env binary and running tests. | ||
FROM golang:${GO_VERSION} AS build | ||
|
||
ARG GO_CI_VERSION=v1.15.0 | ||
|
||
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh \ | ||
| sh -s -- -b /usr/local/bin ${GO_CI_VERSION} | ||
|
||
WORKDIR /code | ||
|
||
ENV GO111MODULE=on | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
ARG GIT_COMMIT=unknown | ||
ARG BUILD_DATE=unknown | ||
ARG VERSION=0.0.1 | ||
ARG BUILD_NUMBER=0 | ||
|
||
RUN make build | ||
|
||
# The release (default) stage is a minimal production image suitable for use | ||
# as the base image to applications. | ||
FROM alpine AS release | ||
|
||
FROM alpine | ||
COPY --from=build /code/aws-env /usr/local/bin | ||
|
||
ENTRYPOINT ["aws-env"] |
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