I installed Docker Desktop on my Windows 11 and pulled the latest Debian image. When I start the Debian container, it shows I'm logged in as the root user, but whenever I attempt to run commands like 'adduser', I get a 'command not found' error. Am I missing something? What's the correct way to get Debian running in Docker? Thanks!
4 Answers
Just a heads up, Debian containers aren't complete Debian installations. If you're looking for a full Linux experience, a virtual machine would be a better choice. Containers are meant to run specific applications, so commands might not always be available.
You need to keep in mind that container images are really minimal. While 'adduser' used to come with older Debian versions, the newer trixie image doesn't include it by default. Try running 'apt-get update' first, then install the required packages using 'apt-get install'. You might want to check if 'debian:trixie' is a better option than 'debian:latest' for your purposes.
Are you forgetting to use 'sudo' before your commands? That might be the issue. Even as root, some commands might require it depending on how the image is set up.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures