Skip to content

Commit

Permalink
Optimize Dockerfile for build cache.
Browse files Browse the repository at this point in the history
- Follow the principle of moving more frequently changing parts of the
  Dockerfile further to the bottom, namely the Bamboo code itself.
- Do not install Go packages atomically, leveraging the Docker cache per
  package.
  • Loading branch information
timoreimann committed May 8, 2017
1 parent 7acac5a commit 7f8f518
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ RUN apt-get update -yqq && \
apt-get install -yqq haproxy -t jessie-backports-1.5 && \
rm -rf /var/lib/apt/lists/*

ADD . /go/src/github.com/QubitProducts/bamboo
ADD builder/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD builder/run.sh /run.sh

WORKDIR /go/src/github.com/QubitProducts/bamboo

RUN go get github.com/tools/godep && \
go get -t github.com/smartystreets/goconvey && \
go build && \
go get -t github.com/smartystreets/goconvey

ADD . /go/src/github.com/QubitProducts/bamboo

RUN go build && \
ln -s /go/src/github.com/QubitProducts/bamboo /var/bamboo && \
mkdir -p /run/haproxy && \
mkdir -p /var/log/supervisor
Expand Down

0 comments on commit 7f8f518

Please sign in to comment.