Skip to content

Problem with the docker image documentation #489

@Keftcha

Description

@Keftcha

For the command line tool in the docker section (here). You tell that the command to use is

docker run -i tdewolff/minify
echo "(function(){ if (a == false) { return 0; } else { return 1; } })();" | minify --type js

That command will return the error with the latest docker image:

ERROR: must specify --bundle for multiple input files with stdout destination

That's because the ENTRYPOINT of your container is the minify command and the real command run in the container this

minify echo "(function(){ if (a == false) { return 0; } else { return 1; } })();"

Remark: the minify command is not run in the container because of the pipe

To correct that I think there is two way.

  1. Removing the ENTRYPOINT and replace it with a CMD or with nothning (as the container willn't do any thing if nothing is given.
    I don't thing it's a good solution because it will break things when peoples update to the latest vestion of the container.

  2. The other solution is to precise in the documentation what is the entrypoint and the cmd in the container. With that peoples will be able to overwrite the ENTRYPOINT in the command line with the --entrypoint option.
    The full command must be

docker run -i --entrypoint "" tdewolff/minify sh -c 'echo "(function(){ if (a == false) { return 0; } else { return 1; } })();" | minify --type js'

Remark: the command run in the container is sh -c 'echo "(function(){ if (a == false) { return 0; } else { return 1; } })();" | minify --type js'. This is for executing the pipe inside the container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions