Skip to content

Commit

Permalink
Dockefile: use ADD instead of COPY and rearrange (#340)
Browse files Browse the repository at this point in the history
Couple changes to improve local development, building, etc.

* use ADD instead of COPY to force cache invalidation
* rearrange to cache more expensive network downloads (apk, etc),
  ADDing locally built binaries at last
  • Loading branch information
jjo authored and murali-reddy committed Mar 19, 2018
1 parent 9b6bf95 commit faead6d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
FROM alpine:3.7

COPY kube-router gobgp /usr/local/bin/
COPY build/image-assets/bashrc /root/.bashrc
COPY build/image-assets/profile /root/.profile
COPY build/image-assets/vimrc /root/.vimrc
COPY build/image-assets/motd-kube-router.sh /etc/motd-kube-router.sh

RUN apk add --no-cache \
iptables \
ipset \
Expand All @@ -17,8 +11,14 @@ RUN apk add --no-cache \
mkdir -p /var/lib/gobgp && \
mkdir -p /usr/local/share/bash-completion && \
curl -L -o /usr/local/share/bash-completion/bash-completion \
https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion && \
cd && \
https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion

ADD build/image-assets/bashrc /root/.bashrc
ADD build/image-assets/profile /root/.profile
ADD build/image-assets/vimrc /root/.vimrc
ADD build/image-assets/motd-kube-router.sh /etc/motd-kube-router.sh
ADD kube-router gobgp /usr/local/bin/
RUN cd && \
/usr/local/bin/gobgp --gen-cmpl --bash-cmpl-file /var/lib/gobgp/gobgp-completion.bash

WORKDIR "/root"
Expand Down

0 comments on commit faead6d

Please sign in to comment.