-
Notifications
You must be signed in to change notification settings - Fork 413
Description
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:
- Make
overrideCommandoverwriteCMDand notENTRYPOINT, default istrue. - Create a new option
overrideEntrypoint, which overridesENTRYPOINTand notCMD, default isfalse.