Manage Docker Containers With Visual Studio Code

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.

Get Started

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.

Manage Containers

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

Split Terminals

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.

Attach Shell

If I right click on a running Container, I can attach to it using PowerShell using the Attach Shell option

Show Logs

I also have the option to see the logs inside my Containers using the Show Logs menu.

Conclusion

If you manage Windows or Linux container I strongly recommend you use VS Code and get a much better experience managing your Containers.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.