-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile.build to allow building during development.
Recently the Dockerfile used to build the image which goes to hub was updated to pull artefacts from GitHub releases which meant you could no longer build images on the fly for testing. This adds a build Dockerfile so that local changes can be built and tested. Closes #167
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
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,34 @@ | ||
FROM golang:alpine AS builder | ||
|
||
RUN buildDeps=' \ | ||
make \ | ||
git \ | ||
' \ | ||
set -x \ | ||
&& apk --no-cache add $buildDeps \ | ||
&& mkdir -p /go/src/github.com/jrasell/levant | ||
|
||
WORKDIR /go/src/github.com/jrasell/levant | ||
|
||
COPY . /go/src/github.com/jrasell/levant | ||
|
||
RUN \ | ||
make tools && \ | ||
make build | ||
|
||
FROM alpine:latest AS app | ||
|
||
LABEL maintainer James Rasell<(jamesrasell@gmail.com)> (@jrasell) | ||
LABEL vendor "jrasell" | ||
|
||
WORKDIR /usr/bin/ | ||
|
||
COPY --from=builder /go/src/github.com/jrasell/levant/levant-local /usr/bin/levant | ||
|
||
RUN \ | ||
apk --no-cache add \ | ||
ca-certificates \ | ||
&& chmod +x /usr/bin/levant \ | ||
&& echo "Build complete." | ||
|
||
CMD ["levant", "--help"] |