Scott Hanselman

Docker for Windows Beta announced

March 27, 2016 Comment on this post [17] Posted in VS2015
Sponsored By

Docker Desktop AppI'm continuing to learn about Docker and how it works in a developer's workflow (and Devops, and Production, etc as you move downstream). This week Docker released a beta of their new Docker for Mac and Docker for Windows. They've included OS native apps that run in the background (the "tray") that make Docker easier to use and set up. Previously I needed to disable Hyper-V and use VirtualBox, but this new Docker app automates Hyper-V automatically which more easily fits into my workflow, especially if I'm using other Hyper-V features, like the free Visual Studio Android Emulator.

I signed up at http://beta.docker.com. Once installed, when you run the Docker app with Hyper-V enabled Docker automatically creates the Linux "mobylinux" VM you need in Hyper-V, sets it up and starts it up.

"Moby" the Docker VM running in Hyper-V

After Docker for Windows (Beta) is installed, you just run PowerShell or CMD and type "docker" and it's already set up with the right PATH and Environment Variables and just works. It gets setup on your local machine as http://docker but the networking goes through Hyper -V, as it should.

The best part is that Docker for Windows supports "volume mounting" which means the container can see your code on your local device (they have a "wormhole" between the container and the host) which means you can do a "edit and refresh" type scenarios for development. In fact, Docker Tools for Visual Studio uses this feature - there's more details on this "Edit and Refresh "support in Visual Studio here.

The Docker Tools for Visual Studio can be downloaded at http://aka.ms/dockertoolsforvs. It adds a lot of nice integration like this:

Docker in VS

This makes the combination of Docker for Windows + Docker Tools for Visual Studio pretty sweet. As far as the VS Tools for Docker go, support for Windows is coming soon, but for now, here's what Version 0.10 of these tools support with a Linux container:

  • Docker assets for Debug and Release configurations are added to the project
  • A PowerShell script added to the project to coordinate the build and compose of containers, enabling you to extend them while keeping the Visual Studio designer experiences
  • F5 in Debug config, launches the PowerShell script to build and run your docker-compose.debug.yml file, with Volume Mapping configured
  • F5 in Release config launches the PowerShell script to build and run your docker-compose.release.yml file, with an image you can verify and push to your docker registry for deployment to other environment

You can read more about how Docker on Windows works at Steve Lasker's Blog and also watch his video about Visual Studio's support for Docker in his video on Ch9 and again, sign up for Docker Beta at http://beta.docker.com.


Sponsor: Thanks to Seq for sponsoring the feed this week! Need to make sense of complex or distributed apps? Structured logging helps your team cut through that complexity and resolve issues faster. Learn more about structured logging with Serilog and Seq at https://getseq.net.

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
March 27, 2016 0:40
"Docker for Mac and Docker" - is that a typo?
March 27, 2016 1:15
Great ! What about integration of Hyper-V containers / Nano ? From Windows 10 dev machine into a Nano machine with debug experience...
March 27, 2016 2:25
It supported hyper-v for a while. Perhaps the installation required minor command lining.
March 27, 2016 7:41
I would be great if they could release Windows nano and the IIS module for developers to create windows docker images/containers. Without a server 2016 licence. Perhaps under VS or Windows 10 licensing?
Ideally... I think Microsoft should open source nano and make it freely available.
Otherwise your going to see a large market arise based on .net core running on alpine linux based docker containers.

I have reservations about enabling hyper-v on my home pc. It drops frame rates by 10%ish on computer games that have a high frequency of draw calls. I'm not sure there is any solution to that. Maybe if games gained in other ways, perhaps somehow from the gpu being enabled for virtual memory (which hyper-v enables)?
I used virtual box for when I need vm's.
March 27, 2016 18:23
Did you have to wait long for to get access to the beta? I signed up almost immediately - but nothing yet.
March 27, 2016 19:54
Can't wait 'til this gets sorted out with Windows containers, 'cause it feels a bit disjointed at the moment. I've been using them on Win Server 2016 TP4 and I'd like to move forward.
March 28, 2016 16:03
I have had several show stoppers during my install.

First of all I have 64 bit Virtualization On, Win 10 Ent. Build 1511

When I installed the Docker Toolbox 1.10.3 it uninstalled my existing Git for Windows and installed a different one on C:\Users\<username>\AppData\Local\Programs\Git

I also had a previous version of Virtual Box which it uninstalled and installed version 5.0.16

When I tried to run C:\Program Files\Docker Toolbox\start.sh, the script started looking for bash.exe which was installed on my C:\Users\<username>\AppData\Local\Programs\Git\bin

So I edited my system variable paths and added this bin path

I also made the default for .sh files to be the bash.exe on the Git path

When I ran start.sh again, I got the following message:

Hyper-V is installed. VirtualBox wont boot a 64 bit VM when Hyper-V is activated.

It then suggested that I add --virtualbox-no-vtx-check to bypass the issue.

I edited start.sh and changed it to: #!/bin/bash --virtualbox-no-vtx-check

I still get the same error.

BTW Docker from PowerShell and CMD runs fine in command line.

Dusty


March 28, 2016 18:11
Guess now ppl will add a volume in the asp.net container to share the app code between guest and host?
March 28, 2016 20:52
Can i run my win32 app inside a container with this new beta version of Docker?
March 29, 2016 4:48
Hi Scott,

could you please add some extra commentary in the opening paragraph about WHY we want to care/use docker for anything?

I keep reading about 'Docker this, Docker that' but no one has given us some real world examples of WHY I would want to do this?

eg.

I make websites with .NET on windows. But maybe we want to use REDIS on linux**? Have a linux docker and someone how i can access this linux-only-software from my .NET code.

etc..

(I have no idea what are some scenarios -> so the above is just a wild guess. Would love to see plenty of other scenario's listed, too)

-PK-

** (yes, redis is on windows - I use it all the time)
March 29, 2016 12:23
hi everybody, can someone access to the beta version ? i can't log to https://beta.docker.com/
March 29, 2016 14:51
@Pure Krome
Look at the graphics on this page and you immediately will see what's the advantage of this solution.
March 29, 2016 16:22
Michael Simmons: Just 10%? You're lucky.

The difference for me was to get 60Hz in most games with Hyper-V I had to run in 1080p with lowest settings, while without Hyper-V I could run on mid-high at 2160p, given a Skylake and a GTX970.

Kind of hard to profile too, as it seems to be a rather constant penalty. I could not observe any primary culprits in profiling my own code.
March 30, 2016 10:18
@Kieren Johnstone: I signed up yesterday, and got an e-mail with subject "Welcome to Docker's private Beta". It said "We've added you to our waiting list and will be in touch shortly." About an hour later, I got a new e-mail with subject "Welcome aboard", but that linked to the old, VirtualBox, beta.

Has anyone got a download link to the new beta?
March 30, 2016 20:57
The "Welcome aboard" email links to the "Docker for Windows" WITH VirtualBox.
No go :(
April 04, 2016 10:43
Can i run my win32 app inside a container with this new beta version of Docker? Thanks fort to share article.
April 27, 2016 21:54
I still don't know what I can expect from docker for Windows. Is it a more convenient integration of Linux, so that users can run Linux images or Windows or will it be possible to execute native Windows application (without an UI) in containers? Can you give a some more details? Thanks for your post so far!

Comments are closed.

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