Docker container running Ubuntu on Windows

Containers are all the rage right now and rightfully so – not only do they help abstract away some of the complexity and dependencies of your apps and solutions, they also make managing of environments, and, deployments much simpler. And the fact that you can do it in a consistent, and repeatable fashion is just icing on the cake.

As a simple example, with Docker, on Windows (as in my case), I can run a dockerized app, on a different OS than the host, which can also be interactive. 

The command below will spawn a container, pull down the image of Ubuntu and then run an interactive terminal, tying the terminal to the standard input. Of course in this example, this requires that you already have Docker installed (the Community Edition would be just fine to play around with).

docker run --interactive --tty ubuntu bash

Now, with Docker if you do get the following error (on Windows): “Error response from daemon: operating system on which parent image was created is not Windows.” as also shown below, the way to fix it is to switch on Experimental features.

Docker error when trying to run Ubuntu on Windows

To try and fix this, right click on the docker icon in the system tray, choose Settings, and from the setting screen, in the Daemon tab, enable experimental features as shown below.

And after enabling the experimental features, the docker daemon will restart. And post that, if you run the docker command again, it would work as expected:

  • It pulls down the image (which is used to run in the container)
  • Runs Ubuntu in an interactive session (this is because of the option I choose)
  • And all within my PowerShell console on Windows.

This is just the beginning, there of course is a lot more to it.  🙂

Published by

Amit Bahree

This blog is my personal blog and while it does reflect my experiences in my professional life, this is just my thoughts. Most of the entries are technical though sometimes they can vary from the wacky to even political – however that is quite rare. Quite often, I have been asked what’s up with the “gibberish” and the funny title of the blog? Some people even going the extra step to say that, this is a virus that infected their system (ahem) well. [:D] It actually is quite simple, and if you have still not figured out then check out this link – whats in a name?

Leave a Reply

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