A couple of days ago, I came across the Visual Studio Container Tools Extension (Preview) Announcement.
Using docker, this VS2019 extension promises to be very useful for container image development and debugging.
Here is my first run through, using the aspnetapp sample docker image.
Preparation
The extension can be installed directly via Visual Studio 2019, or downloaded from the marketplace, as shown below.
Once installed, you obviously need to have a running container to watch it in action. For my quick test, I’ve chosen the aspnetapp sample image from mcr.microsoft.com/dotnet/framework/samples:aspnetapp, for which I started up a related container with the following command.
docker run -d -p 8000:80 --name aspnet_sample mcr.microsoft.com/dotnet/framework/samples:aspnetapp
Run through
The extension provides an additional container view. Just use search, or View > Other Windows > Containers, to open it.
On the left pane of the Containers view, you get a list of all your available containers. Here you can also start, stop and remove your containers.
The main area provides 4 tabs at the moment, which are used to explore the container in more detail.
If you click on the highlighted Host Port entry on the Ports tab, a related client will be opened, if available.
In my case, that is just a web browser to view the default ASP.NET project template landing page.
Logs allows you to view the output of the docker logs command directly in VS as well. For example:
docker logs aspnet_sample
Last, but certainly not least, there is the Files tab. Personally I think, that this is by far the coolest feature of the extension at the moment. Not only does it allow to easily explore the folder structure of the container, but also directly open the files in visual studio.
Conclusion
I certainly will monitor the progress of the visual studio container tools extension and am looking forward to (hopefully) getting more features (e.g. a docker command line tab) integrated.
21. December 2019
[…] the Visual Studio Container Tools Extensions , I can check the container logs without leaving Visual […]