Home > Back-end >  How to change root shell in Dockerfile
How to change root shell in Dockerfile

Time:09-10

I am writing a Dockerfile to customize the parrotsec/security container to better suit my preferences, and I'd want zsh as the default shell of root. I tried using

RUN chsh -s /usr/bin/zsh

as well as

RUN usermod --shell /usr/bin/zsh root

but after building the image and running it the shell for the root user remains bash.

CodePudding user response:

I believe you'll need to add an ENTRYPOINT to your Dockerfile. If you run a docker inspect <image> you'll see an Entrypoint entry in the output.

See Docker Spawn a shell as a user instead of root which seems pretty closely related to your situation.

  • Related