Skip to content

Commit

Permalink
Using two-stage build to improve container size.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored and mattclay committed Jul 23, 2018
1 parent 77be1b6 commit e3ccfd7
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
FROM golang:1.10-stretch
FROM golang:1.10-stretch as builder
# Install pebble
ARG PEBBLE_CHECKOUT="25448686e9b499e42380ddf965d8e23bd794378c"
ENV GOPATH=/go
RUN go get -u github.com/letsencrypt/pebble/... && \
cd /go/src/github.com/letsencrypt/pebble && \
git checkout ${PEBBLE_CHECKOUT} && \
go install ./...

FROM debian:stretch-slim
# Install software
RUN apt-get update \
&& apt-get install -y bind9 python3 python3-pip \
Expand All @@ -10,12 +19,9 @@ RUN pip3 install -r /root/requirements.txt
ADD bind.conf /etc/bind/named.conf
RUN mkdir /etc/bind/zones
# Install pebble
ARG PEBBLE_CHECKOUT="25448686e9b499e42380ddf965d8e23bd794378c"
ENV GOPATH=/go
RUN go get -u github.com/letsencrypt/pebble/... && \
cd /go/src/github.com/letsencrypt/pebble && \
git checkout ${PEBBLE_CHECKOUT} && \
go install ./...
COPY --from=builder /go/bin /go/bin
COPY --from=builder /go/pkg /go/pkg
COPY --from=builder /go/src/github.com/letsencrypt/pebble/test /go/src/github.com/letsencrypt/pebble/test
ADD pebble-config.json /go/src/github.com/letsencrypt/pebble/test/config/pebble-config.json
# Setup controller.py and run.sh
ADD run.sh controller.py acme_tlsalpn.py LICENSE LICENSE-acme README.md /root/
Expand Down

0 comments on commit e3ccfd7

Please sign in to comment.