Scott Hanselman

Trying out Container Tools in Visual Studio 2019

January 24, 2020 Comment on this post [60] Posted in Docker
Sponsored By

I've been doing more and more work in Docker containers (rather than on the metal) and I noticed recently that Visual Studio 2019 added updated support for containers within VS itself so gave it a try.

When you make a new ASP.NET Core web app, make sure to check "enable docker support" when you click create.

Enable docker support

You'll need Docker for Windows first, of course. I'm using the new Docker Desktop for Windows that uses WSL2 for its backend rather than a utility VM that's visible in Hyper-V.

Now, within Visual Studio 2019, go to the View Menu and click "Other Windows | Containers." I like to dock this new tool window at the bottom.

Container Tool Window in Visual Studio 2019

Note in my screenshot above I'm starting up SQL Server on Linux within a container. This window is fantastic and includes basically everything you'd want to know and see when developing within a container.

You can see the ports exposed, the container's local file system, the environment, and the logs as they happen.

Docker Environment Variables

You can even right-click on a container and get a Terminal Window into that running container if you like:

Terminal in a running Container

You can also see https://aka.ms/containerfastmode to understand how Visual Studio uses your multistage Dockerfile (like the one below) to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["WebApplication1/WebApplication1.csproj", "WebApplication1/"]
RUN dotnet restore "WebApplication1/WebApplication1.csproj"
COPY . .
WORKDIR "/src/WebApplication1"
RUN dotnet build "WebApplication1.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WebApplication1.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]

Go read about the new Container Tools in Visual Studio. Chances are you have a dockerfile in your project but you haven't brought this Containers Tool Window out to play!


Sponsor: Organizations that scan their code more than 300 times a year have 5x less security debt than those with sporadic testing processes. The 2019 SOSS X report from Veracode digs into this data—and more.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service
January 29, 2020 21:50
Unfortunately installing Docker for Windows involves enabling Hyper-V. That in turn completely hoses any VMs for VMWare or VirtualBox that I need. So basically, non-starter for me.
January 30, 2020 0:17
While it may not be "the" answer for your situation @RobertG, I have setup my boot to have Hyper-V on or off as like you I have VirtualBox but I was able to work in an "or" situation. I realize some may not be able to.

How I did it-> Switch easily between virtual box and HyperV with BCDEdit Boot entry from Scott Hanselman. :-)

January 30, 2020 8:20
@RobertG - I had the same issue, and got around it by running ubuntu in a virutal box VM. You can mount your code into the VM, so you can develop in windows, but anytime you need to work with docker you switch to the VM.

Also, Visual Studio Code has a REALLY nice add-in for docker (ms-azuretools.vscode-docker). I use this to manage my containers and images within Ubuntu.
January 30, 2020 10:11
Now only if the new C# .net core app project template will let you build either inside or outside a container and not default to build inside a container always.

Ted
January 30, 2020 11:45
Thank you for sharing a really nice topic
January 30, 2020 14:49
i don't have any knowledge about asp.net
February 01, 2020 23:42
It is among the most useful information I have read for a long time. Good information is given about the current life. Thank you
February 03, 2020 18:39
when i start visual studio 2019 and tries to create a new project from templates i cant find windows form VB that always have been there :( can anyone help me??

February 06, 2020 16:33
Docker n00b here, but why build into the build layer and then turn right around and publish into the publish layer? Does the publish step not accomplish both? Asking to learn rather than to challenge.
October 31, 2020 2:26
Excellent, what a blog it is! This website gives helpful facts to us,
keep it up.
October 31, 2020 15:06
This post will assist the internet viewets for creating new web site or
even a weblog from start to end.
https://writeanessayforme.info/692-dissertation-sol-gel.html
buy my essay
buy my essay
https://writeanessayforme.info/5102-online-essay-service.html https://writeanessayforme.info/5608-chicago-paper-heading.html
October 31, 2020 20:15
Thank you for the good writeup. It in reality was once a amusement account it.
Glance complicated to more brought agreeable from you!
By the way, how can we be in contact?
October 31, 2020 23:21
Howdy! This article couldn't be written any
better! Reading through this article reminds me of my previous roommate!

He continually kept talking about this. I most certainly will
forward this post to him. Pretty sure he'll have a very good read.
Thanks for sharing!
November 01, 2020 2:30
Hi tto every one, the contents present at this web page are
genuinely awesome for people experience, well,
keep up the good wok fellows.
https://admissionessaywritingservice.com
essay writers
essay writers
https://admissionessaywritingservice.com https://admissionessaywritingservice.com
November 01, 2020 9:17
Działamy we wszystkich sektorach rynku nieruchomości.
November 01, 2020 12:57
Every weekend i used to pay a visit this web site, because i wish for enjoyment, as this this web site conations
genuinely good funny material too.
November 01, 2020 14:41
Why visitors still make use of to read news papers when in this
technological globe everything is accessible on net?
November 02, 2020 2:18
Awesome article.
November 02, 2020 3:22
This article is in fact a nice one it helps new web users, who are wishing in favor
of blogging.
November 02, 2020 3:54
Every weekend i used tto pay a quick visit this web site, because i want enjoyment, since this
this website conations actually fastidious funny information too.

https://orderessaycheap.com/
buy essay writing
buy essay writing
https://orderessaycheap.com https://orderessaycheap.com
November 02, 2020 4:42
Hello, after reading this awesome artiocle i am too cheerful to share my experience here
with friends.
https://writingmypaper.info
essay writing websites
essay writing websites
https://persuasiveessays.info https://collegeapplicationessaywritingservice.info
November 02, 2020 4:50
Nice post. I used to be checking continuously tis
weblog and I'm inspired! Extremely useful info particularly the final section :
) I care for such info much. I was seeking this particullar information for a long time.
Thanks and best of luck.
https://researchpaperorder.com
essay writing websites
essay writing websites
https://researchpaperorder.com
November 02, 2020 6:37
Hi, I do think this is a great website. I stumbledupon it ;) I'm going to return yet again since i have
bookmarked it. Money and freedom is the best wayy to change, maay
you bee rich and continue to guide others.
https://writingmypaper.com
best essay writing service review
best essay writing service review
https://writingmypaper.com
November 02, 2020 7:09
Quality articles is the crucial to be a focus for the users to pay a quick visit
the website, that's what this sute is providing.
https://helpassignmentwritingservice.info
research papers
research papers
https://collegeapplicationessaywritingservice.info https://writingmypaper.info
November 02, 2020 7:15
Hi there to everdy body, it's my frst pay a quick visit of this blog;
thiis weblog consists of awesome and actually good data for readers.

https://highqualitywritingservice.com
custom ezsay writing service reviews
custom essay writing service reviews
https://highqualitywritingservice.com
November 02, 2020 7:23
I'm not sure exactly whyy butt this site is loading incredibly slow for me.

Is anyone else having this problem or is it a priblem on my end?
I'll check back later and see if the problem stoll exists.

https://writemycustompaper.com/
help with an essay
help with an essay
https://writemycustompaper.com/ https://writemycustompaper.com/
November 02, 2020 9:10
Have you ever considered writing an e-book or guest authoring onn other
websites? I have a blog based on the same ideas you discuss and would lpve to have you
sharde some stories/information. I know my visitors would
enjoy your work. If you are even rmotely interested, feel free to shoot me
an e-mail.
https://servicethesis.com
write my paper for me
write myy paper for me
https://servicethesis.com/ https://servicethesis.com/
November 02, 2020 9:30
Asking questions are really fastidious thing if
you are not understanding something completely,
except this aticle offers nice understanding even.
https://essaysonservice.com/
essay writer websites
essay writer websites
https://essaysonservice.com/ https://essaysonservice.com/
November 02, 2020 10:03
Hey I know this is off topic buut I was wondering
if you knew of any widgets I could add to my blog that automatically
twert my newest twitter updates. I've been looking for a
plug-in like this for quite some time and was
hoping maybe you would have some experience with something likke this.
Please let mee know if yoou run into anything. I truly enjoy
reading your blog and I look forward to your new updates.


https://professionalessaywritingservice.com
buy essay online safe
buy essaay oonline safe
https://professionalessaywritingservice.com
November 02, 2020 13:38
Thanks in support of sharing such a fastidious thinking, article
is good, thats why i have read it completely
November 02, 2020 15:27
I constantly emailed this website post page to all my contacts, since if like to read it then my friends will
too.
November 02, 2020 17:17
Howdy! This is my first visit to your blog! We are a team of volunteers and starting a new project in a community in the same niche.
Your blog provided us beneficial information to work on. You have
done a extraordinary job!
w88
November 02, 2020 23:13
I just could not depart your website prior to suggesting that I really enjoyed the standard information an individual provide for your guests?
Is going to be back incessantly to investigate cross-check new posts
November 03, 2020 0:18
Hello to all, the contents present at this web
site are genuinely awesome for people experience, well, keep up
the nice work fellows.
November 03, 2020 3:15
naturally like your website but you have to
take a look at the spelling on several of your posts.
Several of them are rife with spelling problems and I to find
it very bothersome to tell the reality then again I will definitely come back
again.
w88
November 03, 2020 4:53
Heya! I understand this is sort of off-topic hkwever I needed to
ask. Does building a well-established website like yours require
a massive mount work? I'm completely new to running a blog
but I do write in my diary everyday. I'd like to start a blog so I can share my experience and feelings online.
Please let me know if yoou have anyy kind of ideas or tips ffor brand new
aspiring blog owners. Thankyou!
https://bestessaywritingservice.info/

write papers for me
https://bestessaywritingservice.info/help-writing-thesis-statement.html
November 03, 2020 5:42
Hurrah, that's what I was seeking for, what a information!
existing here at this website, thanks admin of this web page.

https://australianessaywritingservice.info/
how to write an essay
how to write an essay
https://australianessaywritingservice.info/mental-disorders-essay.html https://australianessaywritingservice.info/academic-and-business-writing-similarities.html
November 03, 2020 9:30
When I initgially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get four emails with the sazme comment.
Is thhere any way you can remove me from tgat service? Thanks a lot!

https://buycustomessay.info/

writing and essay
https://buycustomessay.info/ https://buycustomessay.info/write-that-essay.html
November 03, 2020 9:41
It's potential to get a personal mortgage with unfavorable credit ratings.
November 03, 2020 17:55
Thanks for finally writing about >Trying out Container
Tools in Vsual Studio 2019 - Scott Hanselman's Blog <Liked it!
https://persuasiveessays.info/esl-argumentative-essay.html
writing a paper
writing a paper
https://persuasiveessays.info/research-paper-on-business-management.html https://persuasiveessays.info/how-to-stay-on-top-of-homework.html
November 03, 2020 21:28
Everyone loves what you guys are up too. Such clever work and coverage!

Keep up the wonderful works guys I've added you guys to my blogroll.
November 03, 2020 22:35
Good web site you've got here.. It's difficult to find high quality writing like yours
nowadays. I reaply appreciate individuals like
you! Take care!!
https://buyessaysearch.com
help me write an essay
help me write an essay
https://buyessaysearch.com https://buyessaysearch.com
November 03, 2020 23:38
Awesome issues here. I am very saqtisfied to look your post.

Thank you a lot and I'm having a look ahead to contact you.
Will you please drop me a mail?
https://toppaperwritinghelp.com
write my papewr for me
write my paper for me
https://toppaperwritinghelp.com https://toppaperwritinghelp.com
November 03, 2020 23:59
Thanks for one's marvelous posting! I actually enjoyed reading it,
you may be a great author. I will make certain to bookmark your
blog and will come back down the road. I want to encourage you
to ultimately continue your great job, have a nice weekend!


https://buyessayonlinecheap.info/cheap-writing-service.html
online writing paper
online writing paper
https://buyessayonlinecheap.info/research-writing-service.html https://buyessayonlinecheap.info/essay-on-history.html
November 04, 2020 1:28
What i do not understood is in fact how you're no longer really a lot more neatly-appreciated than you may be right now.
You're so intelligent. You understand thus considerably when it comes to this matter, produced me personally imagine it
from numerous varied angles. Its like women and men are
not interested except it's something to do with Woman gaga!
Your own stuffs excellent. At all times handle it up!
November 04, 2020 2:44
I like the helpful info you supply to your articles. I will bookmark your weblog and take
a look at once more here frequently. I am moderately certain I will be told a lot of new stuff proper right here!

Good luck for the following!
November 04, 2020 10:17
bookmarked!!, I love your web site!
https://writeanessayforme.info/1788-dissertation-report.html
custom essay writing
custom essay writing
https://writeanessayforme.info/6882-cheap-custom-writing.html
November 04, 2020 10:57
I like thhe valuable info you provide in your articles.
I'll bookmark your weblog and check again here regularly.
I'm quite certain I will learn lots of new stuff right here!
Best of luck for the next!
https://servicethesis.info/dissertation-services.html
business esszy writing service
businessessay writing service
https://servicethesis.info https://servicethesis.info/research-paper-for-sale.html
November 04, 2020 14:09
I absolutely love your website.. Pleasant colors
& theme. Did you build thiss amazing site yourself?

Pleae reply back as I'm planning to create mmy own blog and
wnt to learn where you gott this from or what thhe theme is called.
Many thanks!
https://essaywritingtld.com
essay writing service canada
essay writing service canada
https://essaywritingtld.com https://essaywritingtld.com
November 04, 2020 15:35
I know this web site provides quality based posts and other information, is there
any other website which give suuch stuff in quality?
https://buyessayscc.com
essay helper
essay helper
https://buyessayscc.com https://buyessayscc.com
November 04, 2020 17:23
I think this is among thhe most vital info for me. And i am glad reading your
article. But wanna remark on some general things, The site style is wonderful, the articles is really nice : D.Good job, cheers
https://mosspilic.medium.com/essay-in-spanish-8f66b282fc09
college essay wrriting service reviews
college esxay writing service reviews
https://issiahe2rx6lr7z.medium.com/ged-writing-practice-test-essay-16ddc0264748 https://nellieuf7s.medium.com/federalist-essay-number-10-explains-how-a-republic-can-bc34865d62b5
November 04, 2020 18:31
whoah this weblg is magnificent i really like reading your posts.
Stay up the grreat work! You realize, a lot of people are looking round for this information, you could help them greatly.


https://buyessayprices.com
affordable papwr writer
affordable paper writer
https://buyessayprices.com
November 04, 2020 19:53
Every weekend i used to pay a quick visit this web page, as i want enjoyment, for the
reason that tis this site conations truly nice funny data too.

https://essayhelpforall.com/
paper help
paper help
https://essayhelpforall.com/ https://essayhelpforall.com/
November 04, 2020 20:10
Hola! I've been reading your site for some time now and finally ggot the bravery to go ahead and give you a shout outt from Houston Tx!
Justt wanted to say keep up the good work!
https://helpwriting.info/buying-essays-safe.html
essay writing services
essay writing services
https://helpwriting.info/descriptive-essay-conclusion.html https://helpwriting.info/illustrative-paragraph.html
November 04, 2020 20:32
Please llet me know if you're looking for a author for your weblog.
You have some really good articles and I feel I would
be a good asset. If yoou ever want to take some
off the load off, I'd love to write sme content for
your blog in exchane foor a link back to mine. Please blat me an e-mail iff
interested. Kudos!
https://essayserviceuk.info
buy essay paper
buy essay paper
https://essayserviceuk.info/how-to-write-lists.html
November 04, 2020 22:45
Hi there! Do you know if they make aany plugins to
protect against hackers? I'm kinda paranoid about losing
everything I've worked hard on. Any recommendations?
https://onlineessayforyou.com
best websites to write essays
best websites to write essays
https://onlineessayforyou.com https://onlineessayforyou.com
November 05, 2020 1:47
Thanks for sharing your info. I really appreciate
your efforts and I will be waiting for youhr further ost thank you onche again.
https://buyessayonlineforcheap.com
my essay writer
my essay writer
https://essaypaperwritingservice.com https://writepapersforme.com
November 05, 2020 2:28
It's really a nice and useful piecee off information. I'm satisfied that
you just shared this useful info with us. Please keep us informed like this.
Thanks for sharing.
https://essaypaperwritingservice.com/
professional essay writing service
professional essay writiing service
https://essaypaperwritingservice.com
November 05, 2020 2:48
Generally I don't read article on blogs, but I wish to say that
this write-up very compelled me to try and do it!
Your writing style has been amazed me. Thanks, quite great post.


https://allbestessaywritingservice.com
buy essay wrriting service
buy essay writing service
https://allbestessaywritingservice.com https://allbestessaywritingservice.com
November 05, 2020 11:40
I am sure this post haas touched all the internet visitors, its really really good paragraph
on building up new weblog.
https://essayserviceusukua.com
professional resume writing service
professional resume writing service
https://essayserviceusukua.com

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.