Skip to content

Commit

Permalink
Add Dockerfile.build to allow building during development.
Browse files Browse the repository at this point in the history
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
jrasell committed May 14, 2018
1 parent 5591ecd commit e8c20a9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:latest

LABEL maintainer James Rasell<(jamesrasell@gmail.com> (@jrasell)
LABEL maintainer James Rasell<(jamesrasell@gmail.com)> (@jrasell)
LABEL vendor "jrasell"

ENV LEVANT_VERSION 0.1.1
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile.build
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"]

0 comments on commit e8c20a9

Please sign in to comment.