Image operating system linux cannot be used on this platform

Error image operating system «linux» cannot be used on this platform on Windows 10 #27668

Comments

happysysadm commented Oct 23, 2016

I am unable to run a linux container (like Ubuntu) on a windows 10 host.

docker run ubuntu Unable to find image ‘ubuntu:latest’ locally latest: Pulling from library/ubuntu C:\Program Files\Docker\docker.exe: image operating system «linux» cannot be used on this platform. See ‘C:\Program Files\Docker\docker.exe run —help’.

docker version
Client:
Version: 1.13.0-dev
API version: 1.25
Go version: go1.7.3
Git commit: 95c36b3
Built: Fri Oct 21 17:13:27 2016
OS/Arch: windows/amd64

Server:
Version: 1.13.0-dev
API version: 1.25
Go version: go1.7.3
Git commit: 95c36b3
Built: Fri Oct 21 17:13:27 2016
OS/Arch: windows/amd64

docker info
Containers: 10
Running: 0
Paused: 0
Stopped: 10
Images: 2
Server Version: 1.13.0-dev
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: l2bridge l2tunnel nat nat null null transparent
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 14393 (14393.321.amd64fre.rs1_release_inmarket.161004-2338)
Operating System: Windows 10 Enterprise N 2016 LTSB
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 15.88 GiB
Name: win10pc
ID: PAU2:6PDB:FU47:KCOP:XDWO:EZ3B:KD3E:26HQ:FLY3:EI23:AWLU:SFO7
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
My environment is a physical Windows 10 version 1607 (build 14393.321).

The text was updated successfully, but these errors were encountered:

Источник

Mixing Windows and Linux containers with Docker Compose

March 21st, 2019

Premier Developer Consultant Randy Patterson explores how to mix Windows and Linux containers with Docker Compose.

Running Linux containers on a Windows host has been available for awhile now. However, getting Windows and Linux containers to communicate without Docker Compose results in using the containers’ IP Addresses. This is not a good solution since container IP Addresses change often. A better solution is to take advantage of the Docker Compose networking and use the service name instead of the IP address. A Windows host has no problem running Linux containers but Docker Compose does not automatically support multi-platform hosts.

Читайте также:  Драйвер для canon mf4890dw для windows 10

The platform configuration option was added to Docker Compose files starting with version 2.4 and then removed beginning with version 3.x. It is a know bug and the expectation is that the platform option will return soon. When this article was written, it has not yet appeared in version 3.x so we will continue to use file format version 2.4 for our Docker Compose yaml files.

Setting up your environment

Running Linux containers on Windows and platform support in Docker Compose requires Windows 1803 or greater. I am running Windows 10 1809.

In addition, you must be running the latest version of Docker for Windows and have the experimental features enabled.

If you are running different versions of Windows or Docker your mileage may vary.

Source Code

Next, grab the source code located in the GitHub repo here containing two solutions

  1. Webtier.sln – Asp.Net MVC application running .NET Framework 4.6.x and a Dockerfile for creating a Windows image hosting IIS.
  2. ApiTier.sln – Asp.Net Core 2.1 application and a Dockerfile for creating a Linux image to host the application

The application is a simple web page that displays the hostname of the Web Tier then calls the API Tier to get and display the API hostname. When running in containers, the container Id is displayed. Your Id’s will be different

Docker-Compose

The docker-compose.yml file, located in the root of the solution, adds the platform: windows parameter to the webtier service and the platform: linux parameter to the apitier service.

Next, bring up the multi-container, multi-platform application using docker-compose. Start a powershell prompt in the solutions root folder, the same folder that contains the docker-compose.yml file. Type the command:

Docker Compose will create the images if they do not already exist, then create the virtual network to host the containers and finally start the containers in the correct order.

Finally, retrieve the host port of the webtier container

Use your browser to navigate to http://localhost:38736 (your port number will be different)

If the Windows Web Tier was able to communicate with the Linux API Tier, you will see the id for each of the containers (your id’s will be different) on the web page.

Читайте также:  Download windows 10 new install

Using the platform option in your configuration files allows Docker Compose to mix Windows and Linux containers when hosted on a multi-platform host like Windows. Keep in mind that this is an experimental feature and is not yet ready for production environments.

Developer Support

App Dev Customer Success Account Manager, Microsoft Developer Support

Read next

3 comments

Hi,
a very nice article.
I am using LCOW for several months and it works for integration tests ina mixed environment very well.But now I have a problem using microsoft/dotnet:2.2-aspnetcore-runtime(or …-alpine) for the linux images.
Building the docker image on linux with this base image and running it in anLCOW environment works in that way that the container starts and itsfunctions are available.
But if I want to stop the container it takes several minutes to stop thecontainer.
Do you have any idea why it takes so long?
Best regardsChristian

Thanks for the comment Christian. LCOW containers taking a long time to stop is a known issue that hasn’t been fixed yet. I don’t always experience it with ‘docker stop’ but I do with ‘docker-compose down’. Just be patient for now and don’t kill the process. ‘docker-compose down’ will also remove the network it created and if that gets interupted it can be difficult to fix.

Источник

Image operating system linux cannot be used on this platform

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Asked by:

Question

I pushed a linux base image to azure registry. I am trying to pull the image and run it (which will run some api tests).

Error am getting:

image operating system «linux» cannot be used on this platform

I installed the following tools to run the job:

az acr login —name

docker pull
docker run -it

When I run the pipeline, I get that error above

Thank you very much for your help

All replies

Looks like you have docker configured to run Windows containers instead of Linux. You can check if this is the case by right clicking the docker icon on your desktop

As you can see mine is setup to run Linux as it asks if I want to switch to Windows. The opposite would be true if you are running Windows. Check that and see if that helps.

Источник

image operating system «linux» cannot be used on this platform #2879

Comments

santoshmb commented Jul 26, 2017

Expected behavior

Actual behavior

image operating system «linux» cannot be used on this platform

Читайте также:  C0000135 windows hs is

Information about the Issue

Windows 10 LTSB on VMWARE ESXi

C:\Users>docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.06.0-ce
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 14393 (14393.0.amd64fre.rs1_release.160715-1616)
Operating System: Windows 10 Enterprise 2016 LTSB Evaluation
OSType: windows
Architecture: x86_64
CPUs: 1
Total Memory: 5.999GiB
Name: US-NJ1v20221W05
ID: JCXT:UITZ:PPY2:VDAP:MGZU:JY7X:NL5X:6KKO:7U6F:AWUP:4ERL:HETB
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: -1
Goroutines: 31
System Time: 2017-07-26T10:55:47.9092339-04:00
EventsListeners: 1
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

C:\Users\santoshadm>docker version
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:30:30 2017
OS/Arch: windows/amd64

Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.24)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 22:19:00 2017
OS/Arch: windows/amd64
Experimental: true

Steps to reproduce the behavior

  1. . Fresh Windows 10 VM
  2. . New Docker CE Edition
    Start Docker — fails

The text was updated successfully, but these errors were encountered:

Источник

Docker — image operating system «windows» cannot be used on this platform

I tried this on my Windows 10 machine:

4 Answers 4

Your Docker host is configured to run Linux containers inside of a VM. To run Windows containers, you need to «Switch to Windows containers» in the Docker menu. Documentation on that is available here.

You need to go to the Taskbar → right click the Docker icon → use option Switch to Windows containers.

Switch to Windows Container needs to selected from docker icon running under hidden icon from the bottom right. The moment you switch from Linux to Windows or Windows to Linux, Docker daemon automatically restarts to consider switched container.

I would highly recommend you to view these 2 links to get more insight into how to create window containers:

I really found the content of these links very helpful to make a window container which is still being enhanced for the generic issue we are all are facing since support for window container is yet to mature like Linux containers!

Источник

Оцените статью