Running commands inside a container
Containers are a different kind of abstraction that take some getting used to. They're not really designed to be interacted with in the same way you would interact with a virtual machine. Containers are not domain-joined (although your container host might be), and they lack a lot of the bells and whistles we take for granted when using a normal operating system. But you can still run commands inside a container if you need to – which is particularly useful for troubleshooting.
Getting started
You need a Windows Server 2019 machine that has a container running. The previous recipe, Running your first container, can help you achieve that.
How to do it…
On your Windows Server machine, do the following:
- Open PowerShell as an Administrator if you haven't already.
- Let's see which containers are currently running. Run
docker ps
to do so. - Hopefully, you have at least one container that is in the
running...