Skip to content

Commit 2ac6a80

Browse files
author
Matthew Fisher
committed
ref(*): move ADD command to bottom
This effectively lets us cache the VOLUME, WORKDIR, EXPOSE, etc. entries whenever we make changes to the components, speeding up local development compilation.
1 parent e3e94fa commit 2ac6a80

7 files changed

Lines changed: 13 additions & 23 deletions

File tree

builder/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ RUN echo "%git ALL=(ALL:ALL) NOPASSWD:/home/git/builder" >> /etc/sudoers
4040
RUN wget -O /progrium_cedarish.tar --progress=dot:giga \
4141
https://s3-us-west-2.amazonaws.com/opdemand/progrium_cedarish_2014.05.27.tar
4242

43-
# add the current build context to /app
44-
ADD . /app
45-
RUN chown -R root:root /app
46-
4743
# define the execution environment
4844
VOLUME /var/lib/docker
4945
WORKDIR /app
5046
ENTRYPOINT ["/app/bin/entry"]
5147
CMD ["/app/bin/boot"]
5248
EXPOSE 22
49+
50+
ADD . /app
51+
RUN chown -R root:root /app

cache/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ RUN apt-get update && apt-get install -yq python-software-properties
66
RUN add-apt-repository ppa:chris-lea/redis-server -y
77
RUN apt-get update && apt-get install -yq redis-server
88

9-
# add the current build context to /app
10-
ADD . /app
11-
12-
# define the execution environment
139
WORKDIR /app
1410
CMD ["/app/bin/boot"]
1511
EXPOSE 6379
12+
ADD . /app

controller/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ WORKDIR /app
3434
ADD requirements.txt /app/requirements.txt
3535
RUN pip install -r /app/requirements.txt
3636

37-
# clone the project into /app
3837
ADD . /app
3938

4039
# Create static resources

database/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc
66
RUN wget --quiet --no-check-certificate -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
77
RUN apt-get update && apt-get install -yq postgresql-9.3 && /etc/init.d/postgresql stop
88

9-
# add the current build context to /app
10-
ADD . /app
11-
129
# define the execution environment
1310
VOLUME ["/var/lib/postgresql"]
1411
WORKDIR /app
1512
CMD ["/app/bin/boot"]
1613
EXPOSE 5432
14+
ADD . /app

logger/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ RUN mkdir -p /go
99
ENV GOPATH /go
1010
ENV PATH /usr/local/bin:/usr/bin:/bin:/sbin:/usr/local/go/bin
1111

12-
# add the current build context to /app
13-
ADD . /app
14-
ADD . /go/src/github.com/deis/deis/logger
15-
16-
# compile the binary
17-
RUN cd /go/src/github.com/deis/deis/logger/syslogd && go install -v .
18-
1912
# create /var/log/deis for holding logs (access via bind mount)
2013
RUN mkdir -p /var/log/deis
2114

2215
# prepare execution environment
2316
WORKDIR /app
2417
CMD ["/app/bin/boot"]
2518
EXPOSE 514
19+
20+
ADD . /app
21+
ADD . /go/src/github.com/deis/deis/logger
22+
23+
# compile the binary
24+
RUN cd /go/src/github.com/deis/deis/logger/syslogd && go install -v .

registry/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ RUN mkdir -p /data/repositories && chown -R registry:registry /data
3636
ENV STORAGE_PATH /data
3737
VOLUME /data
3838

39-
# add the current build context to /app
40-
ADD . /app
41-
4239
# define the execution environment
4340
WORKDIR /app
4441
CMD ["/app/bin/boot"]
4542
EXPOSE 5000
43+
ADD . /app

router/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN patch -p1 < /tmp/nginx_tcp_proxy_module-0.4.5/tcp.patch
1616
RUN ./configure --prefix=/var/lib/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_spdy_module --with-http_sub_module --with-mail --with-mail_ssl_module --add-module=/tmp/nginx_tcp_proxy_module-0.4.5
1717
RUN make && make install
1818

19-
ADD . /app
2019
WORKDIR /app
2120
EXPOSE 80 2222
2221
CMD ["/app/bin/boot"]
22+
ADD . /app

0 commit comments

Comments
 (0)