Creating the "docker save" tarball for "scratch" is pretty simple. I've also extrapolated the "docker build -t busybox ." logic into a separate "hack/make/.ensure-busybox" file so that it can eventually be reused easier.
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,10 @@ |
| 0 |
+#!/bin/bash |
|
| 1 |
+ |
|
| 2 |
+if ! docker inspect busybox &> /dev/null; then |
|
| 3 |
+ if [ -d /docker-busybox ]; then |
|
| 4 |
+ source "$(dirname "$BASH_SOURCE")/.ensure-scratch" |
|
| 5 |
+ ( set -x; docker build -t busybox /docker-busybox ) |
|
| 6 |
+ else |
|
| 7 |
+ ( set -x; docker pull busybox ) |
|
| 8 |
+ fi |
|
| 9 |
+fi |
| 0 | 10 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,21 @@ |
| 0 |
+#!/bin/bash |
|
| 1 |
+ |
|
| 2 |
+if ! docker inspect scratch &> /dev/null; then |
|
| 3 |
+ # let's build a "docker save" tarball for "scratch" |
|
| 4 |
+ # see https://github.com/dotcloud/docker/pull/5262 |
|
| 5 |
+ # and also https://github.com/dotcloud/docker/issues/4242 |
|
| 6 |
+ mkdir -p /docker-scratch |
|
| 7 |
+ ( |
|
| 8 |
+ cd /docker-scratch |
|
| 9 |
+ echo '{"scratch":{"latest":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"}}' > repositories
|
|
| 10 |
+ mkdir -p 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158 |
|
| 11 |
+ ( |
|
| 12 |
+ cd 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158 |
|
| 13 |
+ echo '{"id":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158","comment":"Imported from -","created":"2013-06-13T14:03:50.821769-07:00","container_config":{"Hostname":"","Domainname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"ExposedPorts":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":null,"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"NetworkDisabled":false,"OnBuild":null},"docker_version":"0.4.0","architecture":"x86_64","Size":0}' > json
|
|
| 14 |
+ echo '1.0' > VERSION |
|
| 15 |
+ tar -cf layer.tar --files-from /dev/null |
|
| 16 |
+ ) |
|
| 17 |
+ ) |
|
| 18 |
+ ( set -x; tar -cf /docker-scratch.tar -C /docker-scratch . ) |
|
| 19 |
+ ( set -x; docker load --input /docker-scratch.tar ) |
|
| 20 |
+fi |
| ... | ... |
@@ -30,13 +30,7 @@ bundle_test_integration_cli() {
|
| 30 | 30 |
# pull the busybox image before running the tests |
| 31 | 31 |
sleep 2 |
| 32 | 32 |
|
| 33 |
- if ! docker inspect busybox &> /dev/null; then |
|
| 34 |
- if [ -d /docker-busybox ]; then |
|
| 35 |
- ( set -x; docker build -t busybox /docker-busybox ) |
|
| 36 |
- else |
|
| 37 |
- ( set -x; docker pull busybox ) |
|
| 38 |
- fi |
|
| 39 |
- fi |
|
| 33 |
+ source "$(dirname "$BASH_SOURCE")/.ensure-busybox" |
|
| 40 | 34 |
|
| 41 | 35 |
bundle_test_integration_cli |
| 42 | 36 |
|