From faead6dbebaa2d627671fa0a3bc6dfc0177a2b90 Mon Sep 17 00:00:00 2001 From: JuanJo Ciarlante Date: Mon, 19 Mar 2018 13:20:32 -0300 Subject: [PATCH] Dockefile: use ADD instead of COPY and rearrange (#340) 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 --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3394478ccd..1db7e3b76a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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"