Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)

I inherited the Windows Server Core machine, and I want to run the Linux-based containers in docker on that machine. It is currently set up to run the windows-based containers, so I want to switch on running Linux containers.

When I try to use the Linux-based image, I get this error:

PS C:\Program Files\Docker> docker pull my-linux-based-image

Pulling from my-linux-based-image

Image operating system "Linux" cannot be used on this platform

On my Windows desktop machine, I would use a Docker Desktop context menu from the system tray to switch between the Linux and Windows containers, but that's not available in Windows Core. Can I make this switch from the command line?

I see the suggestion to use the DockerCli.exe but I don't have this installed, even after making sure I installed the latest docker package. Is there a separate cli-related package I need?

Here is version info for this docker install on my Windows Core machine:

PS C:\Program Files\Docker> docker version

Client: Docker Engine - Enterprise

 Version:           18.09.8

 API version:       1.39

 Go version:        go1.10.8

 Git commit:        90e30bdf98

 Built:             07/16/2019 17:13:22

 OS/Arch:           windows/amd64

 Experimental:      false

Server: Docker Engine - Enterprise

 Engine:

  Version:          18.09.8

  API version:      1.39 (minimum version 1.24)

  Go version:       go1.10.8

  Git commit:       90e30bdf98

  Built:            07/16/2019 17:11:04

  OS/Arch:          windows/amd64

  Experimental:     false

1 Answer

0 votes
by (36.8k points)

Dockercli -SwitchDaemon option should help you.

$ ./DockerCli.exe

Usage: DockerCli.exe [-SwitchDaemon] [-Version]

-Version: Show the Docker for Windows version information

-SwitchDaemon: Point the Docker CLI to either Linux containers or Windows containers

-SharedDrives: List the shared drives

You can control which engine you want to switch with using the option.

-SwitchLinuxEngine

-SwitchWindowsEngine

DockerCli.exe can be found in the program Files folder.

In my case, it was:

/c/Program\ Files/Docker/Docker/DockerCli.exe

Hope this will help you.

Want to be a Linux expert? Come and join this linux course

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...