mirror of https://github.com/docker/docs.git
Merge pull request #10230 from tianon/emptyfs
Update emptyfs support to work properly if scratch is already an image
This commit is contained in:
commit
bb4025c4e2
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
if ! docker inspect busybox &> /dev/null; then
|
if ! docker inspect busybox &> /dev/null; then
|
||||||
if [ -d /docker-busybox ]; then
|
if [ -d /docker-busybox ]; then
|
||||||
source "$(dirname "$BASH_SOURCE")/.ensure-scratch"
|
|
||||||
( set -x; docker build -t busybox /docker-busybox )
|
( set -x; docker build -t busybox /docker-busybox )
|
||||||
else
|
else
|
||||||
( set -x; docker pull busybox )
|
( set -x; docker pull busybox )
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
if ! docker inspect scratch &> /dev/null; then
|
if ! docker inspect emptyfs &> /dev/null; then
|
||||||
# let's build a "docker save" tarball for "emptyfs"
|
# let's build a "docker save" tarball for "emptyfs"
|
||||||
# see https://github.com/docker/docker/pull/5262
|
# see https://github.com/docker/docker/pull/5262
|
||||||
# and also https://github.com/docker/docker/issues/4242
|
# and also https://github.com/docker/docker/issues/4242
|
||||||
mkdir -p /docker-scratch
|
dir="$(mktemp -d)"
|
||||||
(
|
(
|
||||||
cd /docker-scratch
|
cd "$dir"
|
||||||
echo '{"emptyfs":{"latest":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"}}' > repositories
|
echo '{"emptyfs":{"latest":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"}}' > repositories
|
||||||
mkdir -p 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158
|
mkdir -p 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158
|
||||||
(
|
(
|
||||||
|
@ -16,6 +17,6 @@ if ! docker inspect scratch &> /dev/null; then
|
||||||
tar -cf layer.tar --files-from /dev/null
|
tar -cf layer.tar --files-from /dev/null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
( set -x; tar -cf /docker-scratch.tar -C /docker-scratch . )
|
( set -x; tar -cC "$dir" . | docker load )
|
||||||
( set -x; docker load --input /docker-scratch.tar )
|
rm -rf "$dir"
|
||||||
fi
|
fi
|
|
@ -20,6 +20,7 @@ bundle_test_integration_cli() {
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
source "$(dirname "$BASH_SOURCE")/.ensure-busybox"
|
source "$(dirname "$BASH_SOURCE")/.ensure-busybox"
|
||||||
|
source "$(dirname "$BASH_SOURCE")/.ensure-emptyfs"
|
||||||
|
|
||||||
bundle_test_integration_cli
|
bundle_test_integration_cli
|
||||||
}; then
|
}; then
|
||||||
|
|
Loading…
Reference in New Issue