-
Notifications
You must be signed in to change notification settings - Fork 220
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
Allow containers to have their own default shells different from the host #908
Comments
Just a workaround: SHELL=/bin/zsh toolbox enter |
Thank you, this works well for now and fits with the alias I already made. I would still like it to just work as expected in the future though. |
I wonder if we need to add a
This might actually speed up our current fallback code path for shells used by |
I like that idea. I'm assuimg that |
Ultimately we need something to look at the user's default shell inside the container, and then run it, and it needs to happen as part of the I suppose there are several ways to do this. One option is to invoke:
... and have the |
I don't know the internals well enough yet to reason about that, but I do think that being able to run just one command to change it is important. If overriding the exising ones to change shell is possible I think that would be the best user experience. |
No, we wouldn't be able to update existing containers in this case, because of the immutability of OCI containers. They would have to be re-created. |
Ah right. Guess an external command is needed then. Maybe for future containers though? |
I’m having a look at how to tackle this issue. I started coding the shell command as proposed and replaced the command used during toolbox/src/cmd/initContainer.go Lines 239 to 257 in e80cba4
|
@alvarlagerlof I tried @yann-soubeyrand Does your PR have the same behavior? Are local directories like |
@VarLad You can using |
@junjieyuan while I'm aware of that, I've a wider issue here #1076 |
Maybe this commit offers some background? When a Toolbx container is created and run for the first time, we want its initial state to match the host as much as possible. Let's call this is the factory state. As part of this factory state, Toolbx sets up the user's default shell inside the container to match that on the host. We need to figure out a way to persistently record (across reboots) that the container was already set up as per this factory state, and that everything from now on is a local change made by the user. This way, Removing this persistent record (whatever it is) should reset the container back to its factory state. This can be very helpful to debug problems and/or recover broken containers by going back to a known-good state. Going by that terminology, one can say that Toolbx containers are somewhat stateless at the moment because |
What I suggested would be purely an internal implementation change inside Toolbx. As a user, you would use chsh(1) or usermod -s inside the container to change your shell. The new command that I suggested is not something that users would actually have to use. It will be an internal detail of the |
Here is another interesting use-case for a
These performance considerations are also valid for #988 because the alternative there is also to use an extra |
Describe the bug
Shell does not change from bash to zsh with neither chsh or usermod -s
Steps how to reproduce the behaviour
Expected behaviour
$SHELL changes from bash to zsh
Actual behaviour
$SHELL stays at bash
Output of
toolbox --version
(v0.0.90+)toolbox version 0.0.99.1
Toolbox package info (
rpm -q toolbox
)toolbox-0.0.99.1-1.fc34.x86_64
Output of
podman version
Podman package info (
rpm -q podman
)podman-3.1.0-1.fc34.x86_64
Info about your OS
Fedora Silverblue 34
The text was updated successfully, but these errors were encountered: