Running commands while creating container

Please, show more details what exactly you are doing and share error messages. When you do that, please follow the below guide to format your post:

What many people are confused about is that Docker containers are not virtual machines (even though Docker Desktop runs containers in a virtual machine) so you need a container that actually runs something in the foreground and keeps the container alive. Also each image can have completely different distributions and not all commands will be available in the container that you would usually use.