github.com/afbjorklund/moby@v20.10.5+incompatible/hack/make/.ensure-emptyfs (about)

     1  #!/usr/bin/env bash
     2  set -e
     3  
     4  if ! docker image inspect emptyfs > /dev/null; then
     5  	# build a "docker save" tarball for "emptyfs"
     6  	# see https://github.com/docker/docker/pull/5262
     7  	# and also https://github.com/docker/docker/issues/4242
     8  	dir="$DEST/emptyfs"
     9  	uuid=511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158
    10  	mkdir -p "$dir/$uuid"
    11  	(
    12  		echo '{"emptyfs":{"latest":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"}}' > "$dir/repositories"
    13  		cd "$dir/$uuid"
    14  		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
    15  		echo '1.0' > VERSION
    16  		tar -cf layer.tar --files-from /dev/null
    17  	)
    18  	(
    19  		[ -n "$TESTDEBUG" ] && set -x
    20  		tar -cC "$dir" . | docker load
    21  	)
    22  	rm -rf "$dir"
    23  fi