Skip to content

Instantly share code, notes, and snippets.

@timfreund
Created July 20, 2017 20:00
Show Gist options
  • Save timfreund/8f1f370da1a6cb0aba9ff59b53cca2a4 to your computer and use it in GitHub Desktop.
Save timfreund/8f1f370da1a6cb0aba9ff59b53cca2a4 to your computer and use it in GitHub Desktop.
question about docker build --build-arg
# Just used default remote package mirrors
docker history 58733688722f
IMAGE CREATED CREATED BY SIZE COMMENT
58733688722f About a minute ago /bin/sh -c git clone https://github.com/fu... 1.06GB
19b893454708 7 minutes ago /bin/sh -c apt-get update && apt-get upgra... 118MB
c30daf46b0f9 16 hours ago /bin/sh -c #(nop) MAINTAINER "Tim Freund"... 0B
3bcf97f6f832 4 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ADD file:ede5a88363e3848... 79.2MB
# Set a ENV http_proxy line, saved 2 minutes on the build, but that proxy setting persists
docker history 88f834def75c
IMAGE CREATED CREATED BY SIZE COMMENT
88f834def75c 15 hours ago /bin/sh -c git clone https://github.com/fu... 1.06GB
9f0d24d54cb3 15 hours ago /bin/sh -c apt-get update && apt-get upgra... 118MB
fbd1a5a33cf8 15 hours ago /bin/sh -c #(nop) ENV http_proxy=http://n... 0B
c30daf46b0f9 16 hours ago /bin/sh -c #(nop) MAINTAINER "Tim Freund"... 0B
3bcf97f6f832 4 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ADD file:ede5a88363e3848... 79.2MB
# Used --build-arg http_proxy=http://my-local-apt-cacher-ng/ and also saved 2 minutes. Note the |0 on the commands
docker history c696645d29a5
IMAGE CREATED CREATED BY SIZE COMMENT
c696645d29a5 7 minutes ago |0 /bin/sh -c git clone https://github.com... 1.06GB
03e1041bc0c2 12 minutes ago |0 /bin/sh -c apt-get update && apt-get up... 118MB
c30daf46b0f9 16 hours ago /bin/sh -c #(nop) MAINTAINER "Tim Freund"... 0B
3bcf97f6f832 4 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ADD file:ede5a88363e3848... 79.2MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment