In this blog post, I will show you how I manage Docker Containers on Windows Server, Mac or Linux using Visual Studio code and make the management task of containers easy.
When started working with Windows Containers two years and something years ago one hardest task in the process was the lack of management tools.
Fast forward to today and VS Code has changed everything, and the experience has now 10 X better.
To get started and manage Containers with VS Code the first thing we need to do is downloading VS Code and run it as Administrator.
Before I can manage my Docker Containers, I will need to download the Docker extension for VS code.
Once Installed, VS Code will scan the localhost and will find all the containers on the host as you can see below.
It will also find the all the images and allow me to remove, run or push them.
Using the GUI, I can delete containers that are not needed or restart them using a single click operation.
I can also use the built in terminal window to run commands.
Create and View Running Containers
Using the command below, I will create a Container and in the screenshot you will see it mark as green.
docker run -it --name webapp -p 8080:80 microsoft/iis:latest
VS Code also allows me to use Split Terminals and see my IIS Server running in one side and run code on the second terminal side by side.
If I right click on a running Container, I can attach to it using PowerShell using the Attach Shell option
I also have the option to see the logs inside my Containers using the Show Logs menu.
If you manage Windows or Linux container I strongly recommend you use VS Code and get a much better experience managing your Containers.