Hi Bhawna,
In general, our Docker images are meant for use during packaging and deployment - for building finalized code and running it in a containerized environment.
We didn't plan for the images to be used for active development (editors, etc.) or for interactive logins (sudo). Usually you would edit files on your workstation, then build the Docker images as part of the packaging phase.
With that said, it is possible to get root access within the image. The easiest way is to just run the 'vitess/root' image rather than 'vitess/base'. You can also pass '-u root' as a flag to the 'docker run' command. There is no password set for root in the image, so password-based login does not work.
If you don't mind sharing the higher-level goal you're trying to achieve (starting a cluster to experiment with? editing configs? making code changes and rebuilding?), we can elaborate on the recommended workflow.
Thanks,
Anthony