Skip to content

"The shell form prevents any CMD or run command line arguments from being used" is wrong #14233

@safinaskar

Description

@safinaskar

https://docs.docker.com/engine/reference/builder/ contains this phrase: "The shell form prevents any CMD or run command line arguments from being used". This is not true. Consider this dockerfile:

FROM debian:bullseye
ENTRYPOINT for I in "$@"; do printf '%s\n' "[$I]"; done

I run it so:

sudo docker build -t rep .
sudo docker run -it rep a b

And I see output [b]. So, command line arguments are passed despite shell form.

So, fix the docs. Also double-check everything related to interaction between ENTRYPOINT, CMD and command-line arguments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions