Save build as an image file is saved with quotes on disk

Issue #27 resolved
Maxence Vannier created an issue

If the option "Save the image as a file" is selected during a docker build task the file will be saved on the disk with quotes. This makes impossible to publish a corresponding artifact.

Bamboo version: 6.0.3 build 60004 Docker version: 17.03.1-ce

Comments (2)

  1. Maxence Vannier reporter

    Apparently, you guys do not accept PRs.

    This issue can be easily fixed in "src/main/java/com/atlassian/bamboo/plugins/docker/client/DockerCmd.java", line 197, replace:

            final ProcessCommand saveCommand = ProcessCommand.builder()
                    .add(dockerPath, "save", "--output=\"" + filename + "\"", repository)
                    .build();
    

    by

            final ProcessCommand saveCommand = ProcessCommand.builder()
                    .add(dockerPath, "save", "--output=" + filename, repository)
                    .build();
    

    You already have the variable filename converted to string on line 194:

    public void save(@NotNull final String filename, @NotNull final String repository) throws DockerException
    

    Same for the test file, of course.

    Regards

    Max

  2. Log in to comment