Created
March 25, 2016 02:13
-
-
Save zhangxu/d2cd9b6c39cb627465ea to your computer and use it in GitHub Desktop.
Docker Dangling Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#switch to docker daemon A | |
#build the base dummy the first pass | |
cat - << EOF | docker build -t ossa.docker.oraclecorp.com/dummy/helloworld:latest - | |
FROM busybox | |
RUN echo "world" > hello.txt | |
EOF | |
docker push ossa.docker.oraclecorp.com/dummy/helloworld:latest | |
#switch to docker daemon B | |
#build the child the first pass | |
cat - << EOF | docker build -t child:latest - | |
FROM ossa.docker.oraclecorp.com/dummy/helloworld:latest | |
CMD ["ls", "-lh"] | |
EOF | |
#Switch back to daemon A | |
#build the base dummy the second pass with some modifications | |
cat - << EOF | docker build -t ossa.docker.oraclecorp.com/dummy/helloworld:latest - | |
FROM busybox | |
RUN echo "world" > hello-again.txt | |
EOF | |
docker push ossa.docker.oraclecorp.com/dummy/helloworld:latest | |
#Switch back to B and build the child again | |
cat - << EOF | docker build --pull -t child:latest - | |
FROM ossa.docker.oraclecorp.com/dummy/helloworld:latest | |
CMD ["ls", "-lh"] | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment