-
Notifications
You must be signed in to change notification settings - Fork 331
Suggestion: use overrideCommand as false by default #3614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Only overriding the cmd is not enough because some images set an interpreter as the entrypoint and we want to set cmd to a process that doesn't exit. The only way to do this reliably is by overriding the entrypoint as well. |
@chrmarti I covered this in the description:
Please take a look at the official docs mentioned. 1.
As said, this can be easily addressed by documenting it. And if people want to use images with entry points bad written, they still can by setting the |
These entrypoints are not necessarily badly written, they are just written with a different use than a DevContainer in mind. The goal is to minimize the number of cases where the default behavior does not work and the user needs to add another flag to the devcontainer.json. I think the current default achieves that and we have the flag to turn it off to let the user take control. |
You hit another point which I think is crucial: how do you know that there are more users using a devcontainer which does not comply with entrypoint best practices over the ones who do? As I said, anyone who would like to use docker "from" docker would have to set this option to And I believe we can safely say that these entrypoints are indeed badly written since they do not comply with the Docker best practices for entrypoints. |
@chrmarti by the way, do you know any image which would require this behavior (overwriting the entrypoint)? |
We changed that base on the feedback in #259. |
To avoid breaking existing configurations, we could deprecate |
That's a nice idea. I still believe the default behavior of
|
Uh oh!
There was an error while loading. Please reload this page.
I believe there is something wrong with the concept behind this option
overrideCommand
, let me explain why:In
Dockerfile
s you haveENTRYPOINT
andCMD
(command). The optionoverrideCommand
actually overrides theENTRYPOINT
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 indocker exec
, but only ondocker run
) because of some customization needed. They (entry points) are responsible for correctly calling any further command passed to thedocker run
, orCMD
if none is passed. See the official documentation here, and here.Because of that, the official
docker-from-docker
devcontainer needs to customize thedevcontainer.json
withoverrideCommand
asfalse
. See here.If the reason for leaving it default to
true
is because someone can code aDockerfile
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:
overrideCommand
overwriteCMD
and notENTRYPOINT
, default istrue
.overrideEntrypoint
, which overridesENTRYPOINT
and notCMD
, default isfalse
.The text was updated successfully, but these errors were encountered: