Skip to content

Suggestion: use overrideCommand as false by default #3614

@felipecrs

Description

@felipecrs

I believe there is something wrong with the concept behind this option overrideCommand, let me explain why:

In Dockerfiles you have ENTRYPOINT and CMD (command). The option overrideCommand actually overrides the ENTRYPOINT of the docker image, and not only the command (CMD). Maybe it should be renamed?

Nonetheless, I believe the entry point override should never execute by default. Entry points on Dockerfile's are scripts or programs which are supposed to run the first container initialization (they do not run in docker exec, but only on docker run) because of some customization needed. They (entry points) are responsible for correctly calling any further command passed to the docker run, or CMD if none is passed. See the official documentation here, and here.

Because of that, the official docker-from-docker devcontainer needs to customize the devcontainer.json with overrideCommand as false. See here.

If the reason for leaving it default to true is because someone can code a Dockerfile entry point in a wrong way, not set accordingly to execute the command line, so I say that this is not a VSCode fault and also not a responsibility of VSCode to work around it.

My suggestion is:

  1. Make overrideCommand overwrite CMD and not ENTRYPOINT, default is true.
  2. Create a new option overrideEntrypoint, which overrides ENTRYPOINT and not CMD, default is false.

Metadata

Metadata

Assignees

Labels

containersIssue in vscode-remote containersplan-reviewPM-highlighted item determined to be P1 or P2under-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions