docs/cookbook/container: update docker image builder.
Apparently some newer docker versions crash if there is no "repository" file in the resulting image. Its syntax seems simple enough, described in https://github.com/moby/moby/blob/master/image/spec/v1.md Reported-by: Matthew Singletary <matt.singletary@gmail.com>
This commit is contained in:
parent
2bea74df35
commit
7845f6ddde
1 changed files with 12 additions and 1 deletions
|
|
@ -29,6 +29,17 @@ for layer in $layers; do
|
||||||
ln "$layer.layer" "$dir/$cid/layer.tar"
|
ln "$layer.layer" "$dir/$cid/layer.tar"
|
||||||
parent=$layer
|
parent=$layer
|
||||||
done <$1.layers
|
done <$1.layers
|
||||||
|
last_cid=$cid
|
||||||
|
|
||||||
tar -C "$dir" -cf - $ids >$3
|
# The seemingly-redundant "repositories" file seems to be needed by newer
|
||||||
|
# docker versions.
|
||||||
|
cat >"$dir/repositories" <<-EOF
|
||||||
|
{
|
||||||
|
"$2":{
|
||||||
|
"latest":"$last_cid"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
tar -C "$dir" -cf - $ids repositories >$3
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue