Skip to content

Commit

Permalink
Add a proper cachebust by echoing a build arg set to the current date…
Browse files Browse the repository at this point in the history
… to /dev/null (#241)

Signed-off-by: Chris Kim <[email protected]>
  • Loading branch information
Oats87 authored Aug 26, 2020
1 parent f194afe commit b6e1926
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ COPY --from=build-k8s \

FROM build AS charts
ARG CHARTS_REPO="https://rke2-charts.rancher.io"
ARG CACHEBUST="cachebust"
COPY charts/ /charts/
RUN echo CACHEBUST>/dev/null; CHART_VERSION="v3.13.3" CHART_FILE=/charts/rke2-canal-chart.yml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN echo CACHEBUST>/dev/null; CHART_VERSION="1.10.101" CHART_FILE=/charts/rke2-coredns-chart.yml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN echo CACHEBUST>/dev/null; CHART_VERSION="1.36.300" CHART_FILE=/charts/rke2-ingress-nginx-chart.yml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN echo CACHEBUST>/dev/null; CHART_VERSION="v1.18.4" CHART_FILE=/charts/rke2-kube-proxy-chart.yml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN echo CACHEBUST>/dev/null; CHART_VERSION="2.11.100" CHART_FILE=/charts/rke2-metrics-server-chart.yml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN echo ${CACHEBUST}>/dev/null
RUN CHART_VERSION="v3.13.3" CHART_FILE=/charts/rke2-canal-chart.yml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.10.101" CHART_FILE=/charts/rke2-coredns-chart.yml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.36.300" CHART_FILE=/charts/rke2-ingress-nginx-chart.yml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="v1.18.4" CHART_FILE=/charts/rke2-kube-proxy-chart.yml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="2.11.100" CHART_FILE=/charts/rke2-metrics-server-chart.yml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN rm -vf /charts/*.sh /charts/*.md

# rke-runtime image
Expand Down
1 change: 1 addition & 0 deletions scripts/build-image-runtime
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source ./scripts/version.sh
DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-1} docker image build \
--build-arg TAG=${VERSION} \
--build-arg KUBERNETES_VERSION=${KUBERNETES_VERSION} \
--build-arg CACHEBUST="$(date +%s%N)" \
--tag ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION} \
--tag ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-${GOARCH} \
--target runtime \
Expand Down

0 comments on commit b6e1926

Please sign in to comment.