Skip to content

Instantly share code, notes, and snippets.

@gurjeet
Last active December 23, 2015 23:19
Show Gist options
  • Save gurjeet/6709500 to your computer and use it in GitHub Desktop.
Save gurjeet/6709500 to your computer and use it in GitHub Desktop.
Two consecutive runs of `docker build .` use different caches!
[gurjeet@work:8 ~/dev/xDBAutoTests] T231827 (master)
$ docker build -rm .
Uploading context 51200 bytes
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : RUN apt-get update
---> Using cache
---> 1b917ec69361
Step 3 : RUN apt-get install -y lsb-release
---> Using cache
---> 9d9b1d71e67e
Step 4 : RUN apt-get install -y python-software-properties
---> Using cache
---> 22df072d209f
Step 5 : RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise universe"
---> Using cache
---> 385ae4bf6980
Successfully built 385ae4bf6980
[gurjeet@work:8 ~/dev/xDBAutoTests] T231828 (master)
$ docker build -rm .
Uploading context 51200 bytes
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : RUN apt-get update
---> Using cache
---> 1b917ec69361
Step 3 : RUN apt-get install -y lsb-release
---> Using cache
---> 9d9b1d71e67e
Step 4 : RUN apt-get install -y python-software-properties
---> Using cache
---> e77ee88d4280
Step 5 : RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise universe"
---> Running in 10ae99b2649c
/bin/sh: 1: add-apt-repository: not found
Error build: The command [/bin/sh -c add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise universe"] returned a non-zero code: 127
The command [/bin/sh -c add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise universe"] returned a non-zero code: 127
[gurjeet@work:1 ~/dev/xDBAutoTests] T230551 (master)
$ docker version
Client version: 0.6.3
Go version (client): go1.1.2
Git commit (client): b0a49a3
Server version: 0.6.3
Git commit (server): b0a49a3
Go version (server): go1.1.2
Last stable version: 0.6.3
FROM ubuntu
# Update the software repositories
RUN apt-get update
# Install package for lsb_release binary
RUN apt-get install -y lsb-release
# Install package that provides add-apt-repository
RUN apt-get install -y python-software-properties
# Add the 'universe' repository to package sources list
RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise universe"
[gurjeet@work:8 ~/dev/xDBAutoTests] T231857 (master)
$ docker build -rm .
Uploading context 51200 bytes
Step 1 : FROM ubuntu
---> 8dbd9e392a96
Step 2 : RUN apt-get update
---> Using cache
---> cd4713919099
Step 3 : RUN apt-get install -y lsb-release
---> Using cache
---> 4f00d63c5a56
Step 4 : RUN apt-get install -y python-software-properties
---> Using cache
---> 0a72ad35ec38
Step 5 : RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise universe"
---> Using cache
---> abe61d110082
Successfully built abe61d110082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment