提交 f9172822 编写于 作者: A Alex Bennée

docker: docker.py don't conflate checksums for extra_files

This just gets confusing especially as the helper function doesn't
even take into account any extra files (or the executable). Currently
the actual check just ignores them and also passes the result through
_dockerfile_preprocess so we fix that too.
Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
上级 83405c45
...@@ -206,8 +206,10 @@ class Docker(object): ...@@ -206,8 +206,10 @@ class Docker(object):
tmp_df.write("\n") tmp_df.write("\n")
tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" % tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" %
_text_checksum("\n".join([dockerfile] + _text_checksum(_dockerfile_preprocess(dockerfile)))
extra_files_cksum))) for f, c in extra_files_cksum:
tmp_df.write("LABEL com.qemu.%s-checksum=%s" % (f, c))
tmp_df.flush() tmp_df.flush()
self._do_check(["build", "-t", tag, "-f", tmp_df.name] + argv + \ self._do_check(["build", "-t", tag, "-f", tmp_df.name] + argv + \
...@@ -322,7 +324,7 @@ class BuildCommand(SubCommand): ...@@ -322,7 +324,7 @@ class BuildCommand(SubCommand):
_copy_binary_with_libs(args.include_executable, docker_dir) _copy_binary_with_libs(args.include_executable, docker_dir)
for filename in args.extra_files or []: for filename in args.extra_files or []:
_copy_with_mkdir(filename, docker_dir) _copy_with_mkdir(filename, docker_dir)
cksum += [_file_checksum(filename)] cksum += [(filename, _file_checksum(filename))]
argv += ["--build-arg=" + k.lower() + "=" + v argv += ["--build-arg=" + k.lower() + "=" + v
for k, v in os.environ.iteritems() for k, v in os.environ.iteritems()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册