concept Windows container in category docker

appears as: Windows containers, Windows container, Windows container
Learn Docker in a Month of Lunches

This is an excerpt from Manning's book Learn Docker in a Month of Lunches.

The samples in this book are all cross-platform, so you can work along using Windows, Mac, or Linux--including Arm processors, so you can use a Raspberry Pi too. I use several programming languages, but only those that are cross-platform, so among others I use .NET Core instead of .NET Framework (which only runs on Windows). If you want to learn Windows containers in depth, my blog is a good source for that ( https://blog.sixeyed.com ).

The second scenario is a variation on that: what happens if you mount a single file from the host to a target directory that exists in the container filesystem? This time the directory contents are merged, so you’ll see the original files from the image and the new file from the host--unless you’re running Windows containers, where this feature isn’t supported at all.

The container filesystem is one of the few areas where Windows containers are not the same as Linux containers. Some things do work in the same way. You can use standard Linux-style paths inside Dockerfiles, so /data works for Windows containers and becomes an alias of C:\data . But that doesn’t work for volume mounts and bind mounts, which is why the exercises in this chapter use variables to give Linux users /data and Windows C:\data .

docker-compose up -d --scale iotd=3
 
 # for Linux containers:
 docker container exec -it image-of-the-day_image-gallery_1 sh
 
 # for Windows containers:
 docker container exec -it image-of-the-day_image-gallery_1 cmd
 
 nslookup accesslog
 
 exit