Skip to content

Revert "Ensure ENTRYPOINT command has at least one argument"#1874

Merged
tiborvass merged 1 commit intomoby:masterfrom
thaJeztah:revert_entrypoint_check
Dec 3, 2020
Merged

Revert "Ensure ENTRYPOINT command has at least one argument"#1874
tiborvass merged 1 commit intomoby:masterfrom
thaJeztah:revert_entrypoint_check

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

This reverts commit 174bcf8 (#1862),

This commit attempted to fix a situation where an empty entrypoint was specified, causing a confusing error when running the image (#1119), however, allowing the entrypoint to be reset should be a valid use-case, and running such image on docker 20.10 at least produces an informative error;

docker build -t foo -<<'EOF'
FROM busybox
ENTRYPOINT []
EOF

Or, to reset a previously set entrypoint:

docker build -t foo -<<'EOF'
FROM busybox AS one
ENTRYPOINT ["/bin/busybox"]

FROM one AS two
ENTRYPOINT []
EOF

If no command is specified for the image above:

docker run -it --rm foo
docker: Error response from daemon: No command specified.
See 'docker run --help'.

Passing a command to run:

docker run -it --rm foo sh
/#

Given that this commit resulted in a regression/breaking change this reverts the commit. (see moby/moby#41745)

This reverts commit 174bcf8.

This commit attempted to fix a situation where an empty entrypoint
was specified, causing a confusing error when running the image,
however, allowing the entrypoint to be reset should be a valid
use-case, and running such image on docker 20.10 at least
produces an informative error;

    docker build -t foo -<<'EOF'
    FROM busybox
    ENTRYPOINT []
    EOF

Or, to reset a previously set entrypoint:

    docker build -t foo -<<'EOF'
    FROM busybox AS one
    ENTRYPOINT ["/bin/busybox"]

    FROM one AS two
    ENTRYPOINT []
    EOF

If no command is specified for the image above:

    docker run -it --rm foo
    docker: Error response from daemon: No command specified.
    See 'docker run --help'.

Passing a command to run:

    docker run -it --rm foo sh
    /#

Given that this commit resulted in a regression/breaking change
this reverts the commit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

ping @tonistiigi @AkihiroSuda @tiborvass PTAL

Also see moby/moby#7806, which added a test-case for this use-case, which showed the regression (moby/moby@78a847a)

@tiborvass
Copy link
Copy Markdown
Collaborator

Is TestRuncWorker flaky?

@crazy-max
Copy link
Copy Markdown
Member

@tiborvass

Is TestRuncWorker flaky?

Not essentially linked to this PR, appears a while ago AFAIK

@tiborvass tiborvass merged commit 950603d into moby:master Dec 3, 2020
@tiborvass
Copy link
Copy Markdown
Collaborator

@chang-andrew FYI we had to revert your change, we didn't realize it was a breaking change for valid use cases. Sorry about that! Looks like #1119 was a formatting issue in containerd 1.2 that was fixed in subsequent releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants