Skip to content

Commit

Permalink
Merge pull request #136 from hairyhenderson/smaller-image
Browse files Browse the repository at this point in the history
Making the built Docker image smaller
  • Loading branch information
hairyhenderson authored May 9, 2017
2 parents 9250077 + 47e24de commit 6695b99
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
FROM golang:onbuild
FROM golang:1.8-alpine AS build

RUN mkdir -p /go/src/github.com/hairyhenderson/gomplate
WORKDIR /go/src/github.com/hairyhenderson/gomplate
COPY . /go/src/github.com/hairyhenderson/gomplate

RUN apk add --no-cache \
make \
git

RUN make build

FROM alpine:3.5

ARG BUILD_DATE
ARG VCS_REF
Expand All @@ -7,7 +19,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/hairyhenderson/gomplate"

RUN mv /go/bin/app /go/bin/gomplate
COPY --from=build /go/src/github.com/hairyhenderson/gomplate/bin/gomplate /usr/bin/gomplate

ENTRYPOINT [ "gomplate" ]

Expand Down

0 comments on commit 6695b99

Please sign in to comment.