]> git.proxmox.com Git - mirror_qemu.git/commitdiff
docker.py/build: support -t and -f arguments
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Apr 2020 14:17:08 +0000 (10:17 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Jun 2020 16:09:31 +0000 (12:09 -0400)
The docker.py command line is subtly different from docker and podman's,
in that the tag and Dockerfile are passed via positional arguments.
Remove this gratuitous difference and just parse -f and -t.

-f was previously used by --extra-files, only keep the long option.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/docker/Makefile.include
tests/docker/docker.py

index ed46bd98eb5a910e5fe0d385456a1b3809cf0d61..f32a95b4883307963a1732878b4299f324b7cf69 100644 (file)
@@ -55,7 +55,7 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker
 else
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
        $(call quiet-command,\
-               $(DOCKER_SCRIPT) build qemu:$* $< \
+               $(DOCKER_SCRIPT) build -t qemu:$* -f $< \
                $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
                $(if $(NOUSER),,--add-current-user) \
                $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
index 5a9735db789b42488a3baa52138afe0af221bc53..d96ccc9b19952f815b1b87ff95f55ad9a2b9b8e3 100755 (executable)
@@ -392,16 +392,16 @@ class BuildCommand(SubCommand):
                             help="""Specify a binary that will be copied to the
                             container together with all its dependent
                             libraries""")
-        parser.add_argument("--extra-files", "-f", nargs='*',
+        parser.add_argument("--extra-files", nargs='*',
                             help="""Specify files that will be copied in the
                             Docker image, fulfilling the ADD directive from the
                             Dockerfile""")
         parser.add_argument("--add-current-user", "-u", dest="user",
                             action="store_true",
                             help="Add the current user to image's passwd")
-        parser.add_argument("tag",
+        parser.add_argument("-t", dest="tag",
                             help="Image Tag")
-        parser.add_argument("dockerfile",
+        parser.add_argument("-f", dest="dockerfile",
                             help="Dockerfile name")
 
     def run(self, args, argv):