-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
728dd6a
commit a0f68c0
Showing
13 changed files
with
285 additions
and
117 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
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,30 @@ | ||
# ===> Build Image | ||
FROM golang:1.11.0-alpine3.8 AS builder | ||
LABEL maintainer="Jaskaranbir Dhillon" | ||
|
||
ARG SOURCE_REPO | ||
|
||
ENV DEP_VERSION=0.5.0 \ | ||
CGO_ENABLED=0 \ | ||
GOOS=linux | ||
|
||
# Download and install dep and git | ||
ADD https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 /usr/bin/dep | ||
RUN chmod +x /usr/bin/dep | ||
RUN apk add --update git | ||
|
||
WORKDIR $GOPATH/src/github.com/TerrexTech/${SOURCE_REPO} | ||
|
||
# Copy the code from the host and compile it | ||
COPY Gopkg.toml Gopkg.lock ./ | ||
RUN dep ensure --vendor-only -v | ||
COPY . ./ | ||
|
||
RUN go build -v -a -installsuffix nocgo -o /app ./main | ||
|
||
# ===> Run Image | ||
FROM scratch | ||
LABEL maintainer="Jaskaranbir Dhillon" | ||
|
||
COPY --from=builder /app ./ | ||
ENTRYPOINT ["./app"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.