qemu/tests/docker
Fam Zheng c1958e9d54 docker: Improved image checksum
When a base image locally defined by QEMU, such as in the debian images,
is updated, the dockerfile checksum mechanism in docker.py still skips
updating the derived image, because it only looks at the literal content
of the dockerfile, without considering changes to the base image.

For example we have a recent fix e58c1f9b35 that fixed
debian-win64-cross by updating its base image, debian8-mxe, but due to
above "feature" of docker.py the image in question is automatically NOT
rebuilt unless you add NOCACHE=1. It is noticed on Shippable:

https://app.shippable.com/github/qemu/qemu/runs/541/2/console

because after the fix is merged, the error still occurs, and the log
shows the container image is, as explained above, not updated.

This is because at the time docker.py was written, there wasn't any
dependencies between QEMU's docker images.

Now improve this to preprocess any "FROM qemu:*" directives in the
dockerfiles while doing checksum, and inline the base image's dockerfile
content, recursively. This ensures any changes on the depended _QEMU_
images are taken into account.

This means for external images that we expect to retrieve from docker
registries, we still do it as before. It is not perfect, because
registry images can get updated too. Technically we could substitute the
image name with its hex ID as obtained with $(docker images $IMAGE
--format="{{.Id}}"), but --format is not supported by RHEL 7, so leave
it for now.

Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20171103131229.4737-1-famz@redhat.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
2017-11-08 10:59:21 +08:00
..
dockerfiles docker: add python stdlib dependency (required by keycodemapdb) 2017-11-02 11:46:41 +00:00
common.rc docker: add installation to build tests 2017-09-29 11:14:14 +08:00
docker.py docker: Improved image checksum 2017-11-08 10:59:21 +08:00
Makefile.include docker: fix out-of-tree 'make docker-test-build@debian-powerpc-cross' 2017-10-20 14:28:50 +08:00
run docker: Fix PATH for ccache 2017-10-20 14:28:50 +08:00
test-block docker: test-block: Don't continue if build fails 2017-09-29 11:14:15 +08:00
test-build docker: add installation to build tests 2017-09-29 11:14:14 +08:00
test-clang docker: add installation to build tests 2017-09-29 11:14:14 +08:00
test-full docker: add installation to build tests 2017-09-29 11:14:14 +08:00
test-mingw docker: add installation to build tests 2017-09-29 11:14:14 +08:00
test-quick docker: add installation to build tests 2017-09-29 11:14:14 +08:00
travis docker: Add travis tool 2016-06-01 17:27:35 +08:00
travis.py docker: allow customizing Travis global_env variables 2017-07-18 09:39:19 +01:00