image .NET IConfiguration pipeline viewer Authenticate to Azure Storage with Service Principal and RBAC

Run Docker for Windows in “mixed” mode by running Windows and Linux containers together

I recently learned that I could turn on experimentally features in Docker for Windows and run both Windows and Linux images simultaneously. Normally we need to switch between them, and you can run one or the other. The feature is here for some time now, but below is the 2021 short tutorial :).

1. Switch to Windows containers in Docker for Windows tray

Figure 1: Switch to Windows containers

2. Go to Docker Engine settings section and set experimental parameter to ‘true’

Figure 2: Turn on experimental features.

3. Apply and restart the docker

Figure 3: Apply and restart Docker

4. Run Windows nad Linux docker image

Let’s create a docker-compose file with 2 images:

  • Windows Server Core with IIS (Windows container)
  • SQL 2017 server (Linux container)

If you look carefully in the sql2017 section, you can see the parameter platform: linux. This specifies the platform on which you want to run the image. Save the file to dc-mixed.yml.

Now let’s run the docker-compose file and wait for the containers to download and run:

And that’s it; you are now running both Windows and Linux containers on Docker for Windows. Please note that this is an experimental feature, but I use it for development/test purposes.

Figure 4: Containers running

Till next time!

About Miha
I've always been fascinated by computers. I am happy that I can work in this creative field of software development, where I can solve problems. I am also an avid cyclist :) and I love to learn...a lot!
Related Posts
  • All
  • By Author
  • By Category
  • By Tag

Leave a Reply