-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build binary within docker and make a docker image (#25)
- Loading branch information
Showing
11 changed files
with
222 additions
and
112 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,7 @@ | ||
itests | ||
.idea | ||
.circleci | ||
target | ||
README.md | ||
docs | ||
docker-cache |
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,34 @@ | ||
# Test and build binary | ||
FROM golang:1.11.4-stretch as intermediate | ||
|
||
# Build dependencies | ||
RUN go get github.com/golang/mock/gomock | ||
RUN go install github.com/golang/mock/mockgen | ||
RUN go get github.com/golang/dep/cmd/dep | ||
RUN go install github.com/golang/dep/cmd/dep | ||
|
||
WORKDIR /go/src/github.com/Nextdoor/pg-bifrost.git/ | ||
|
||
# Copy over gopkg and get deps. This will ensure that | ||
# we don't get the deps each time but only when the files | ||
# change. | ||
COPY Gopkg.lock Gopkg.toml ./ | ||
RUN dep ensure --vendor-only | ||
|
||
COPY . . | ||
|
||
# The CI flag is used to control the auto generation of | ||
# code from interfaces (running go generate). In dev we | ||
# want that to happen automatically but in the CI build | ||
# we only want to use the code that was checked in. When | ||
# CI=true generate is not run. | ||
ARG is_ci | ||
ENV CI=$is_ci | ||
|
||
# Run tests and make the binary | ||
RUN make test && make build | ||
|
||
# Package binary in a scratch container | ||
FROM scratch | ||
COPY --from=intermediate /go/src/github.com/Nextdoor/pg-bifrost.git/target/pg-bifrost / | ||
CMD ["/pg-bifrost"] |
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
This file was deleted.
Oops, something went wrong.
Empty file.
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.