-
-
Notifications
You must be signed in to change notification settings - Fork 365
docker: Improve default run behavior #5888
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
base: main
Are you sure you want to change the base?
Conversation
Updates the default docker run behavior to print version text, basic usage information, and a link to more information. This has no impact on anyone already providing custom commands to the container.
You are right about the problem of using the docker image without a command. In your PR, you are helping us understand what is going on. If you look at the differences between exec and shell forms of EXEC in https://docs.docker.com/reference/dockerfile/#cmd, you are changing from exec to shell form, not much more. So, the same problem is still there (but with some nice help). So, the real problem could be fixed by defining an entrypoint + cmd, so that just launching the image would get you in the grass shell; probably the expected usage. Moreover, grass in the terminal is already a shell (with setup done), so it is usable as is in an interactive session. Entrypoint can be overriden on the command line, so it's not an issue here. https://docs.docker.com/reference/dockerfile/#entrypoint So, as you seem to be a user of applications running through docker, and have an idea on what the expected usage for grass would be like, I suggest, after reading the above, to decide on what entrypoint should be used, either:
After that, it would be nice to have the relevant documentation and examples to show the new simplified approach, without having to define the command directly. |
Or just plain, not GRASS, shell? |
@echoix thanks for the detailed response. As background I am actually not a GRASS user at all, I just currently work at NCSU and @wenzeslaus asked me to take a look at your Dockerfiles to see if I had any recommendations. On the whole I did not, other than observing that the default That being said, I have no idea how these containers are generally used. I had thought they might be used in an automated fashion such that someone would launch a container with the appropriate data and command and let it run its course, but it sounds like terminal access is more likely? I would say the best solution depends on your priorities and/or target audience. Messing with the ENTRYPOINT could have advantages but may break things for current users if they need to override it. Using Overall I'm inclined to agree with @wenzeslaus that starting a plain shell would be the simplest and least impactful approach to getting a successfully running container if that's the goal, but ultimately I don't have a personal stake here. |
My question is whether it is something which other containers (from other software) are using, in other words, how common it is to print usage with the default command.
From my experience it would be both, because while the goal might be full automation, the way to get there and discover problems would be interactive shell.
That's what is not clear to me. What may break and when it requires override.
Which is totally fine as I my goal is to get as 3rd party and/or beginner review. (Sort of "my colleague/customer asked me to run their GRASS stuff in the cloud" scenario.) |
Updates the default docker run behavior to print version text, basic usage information, and a link to more information. This has no impact on anyone already providing custom commands to the container.
Currently calling
docker run
without a command results in an error (see #5592), this PR aims to improve the "out of the box" experience for new users without impacting any current workflows.Current behavior:
New behavior:
Edits to the output usage information are welcome.