Skip to content

Instantly share code, notes, and snippets.

@ORESoftware
Created May 3, 2019 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ORESoftware/db551c699d0513d7c114bb6174a8234e to your computer and use it in GitHub Desktop.
Save ORESoftware/db551c699d0513d7c114bb6174a8234e to your computer and use it in GitHub Desktop.
caching steps using git pull
RUN git clone x
ARG CACHEBUST=1
RUN git pull
RUN npm install
# the problem is that npm install will always run
# but we can do this instead
RUN git clone x
ADD https://github.com/whatever/package.json package.json
RUN npm install
ARG CACHEBUST=1
RUN git pull
# so the ADD call is the key thing here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment