Mohammad Trabelsi
Mohammad Trabelsi

Reputation: 3650

Docker: "no matching manifest for windows/amd64 in the manifest list entries"

I use Docker on Windows, and when I tried to pull a PHP image with this command

$ docker pull php

I got this message:

Using default tag: latest
latest: Pulling from library/php no matching manifest for windows/amd64 
        in the manifest list entries

How can I fix this problem?

Upvotes: 351

Views: 523650

Answers (27)

GIRI KUMAR PANEM
GIRI KUMAR PANEM

Reputation: 69

For my case I am using docker in windows 10 got the same error when installing Zookeper and kafka

I have selected Switch to linux container then automatically my zookeeper and kafka installation started

zookeeper and kafka installatio

Upvotes: 0

Rob Sedgwick
Rob Sedgwick

Reputation: 4514

My issue was I had the DOCKER_HOST environment variable set. This was pointing to the WSL version of docker, even though I had stopped it in WSL the env var made Windows still use the WSL daemon.

Clearing this env var did the trick

Remove-Item Env:\DOCKER_HOST

Upvotes: 1

Imran Javed
Imran Javed

Reputation: 12667

There could be many reasons for this error. But most obvious reason for this error is using Windows Container in Linux Container Mode or vice versa.

  1. Right-click Docker icon in the System Tray to open its context menu
  2. Click "Switch to Windows/Linux Containers..."
  3. Click the Switch button in the dialog (it may take little time)
  4. Make sure Docker is in Running state now

Switch Container Mode Dialog

Upvotes: 384

benscabbia
benscabbia

Reputation: 18072

I had this same issue on Windows 10 (2020) and Windows 11 (2023). I bypassed it by running the Docker daemon in experimental mode:

  1. Right click Docker icon in the Windows System Tray
  2. Go to Settings
  3. Select Docker Engine
  4. Edit the Docker daemon file
  5. Set the "experimental": true
  6. Click Apply & Restart Docker

Upvotes: 393

docker run mcr.microsoft.com/windows/servercore:ltsc2016 

try the above command. what you are pulling should be compatible with the underlying windows version you are in. above will work if you are in windows server 2016.

follow this thread for more info

Upvotes: 6

LinkPhoenix
LinkPhoenix

Reputation: 483

Update for Windows 10 20H2

  1. Go to Docker configurations
  2. Go to the Docker Engine tab
  3. Change the line "experimental": false to "experimental": true
  4. Restart Docker using the Apply & Restart button

enter image description here


You can also modify the configuration file manually by opening it with your favorite code editor (Visual code, Notepad++...), like this for example:

# BACKUP Your file with PowerShell
Copy-Item -Path C:\ProgramData\Docker\config\daemon.json -Destination C:\ProgramData\Docker\config\daemon.json.backup

# Open the file with Visual Code
code C:\ProgramData\Docker\config\daemon.json

Or change the string directly with Powershell

# Set Path in variable
$FILE = "C:\ProgramData\Docker\config\daemon.json"

# Replace '"experimental": false' to '"experimental": true'
(Get-Content -Path $FILE) -replace '"experimental": false','"experimental": true' | Set-Content -Path $FILE

# Check the file content
type $FILE

Output example

PS C:\WINDOWS\system32> type $FILE
{
  "registry-mirrors": [],
  "insecure-registries": [],
  "debug": false,
  "experimental": true
}

After your need restart the Docker daemon

PS C:\WINDOWS\system32> Restart-Service docker

Check the status of the service

PS C:\WINDOWS\system32> Get-Service docker
Status   Name               DisplayName
------   ----               -----------
Running  docker             Docker Engine

Upvotes: 17

Samuurai
Samuurai

Reputation: 395

Make sure you aren't trying to use Linux/WSL to pull a Windows image.

Use a Powershell terminal instead.

Upvotes: 2

Willie Cheng
Willie Cheng

Reputation: 8253

Version: Windows 10

Step 1: Right click Docker instance and Go to Settings
enter image description here

Step 2: Basic to Advanced and setting the "experimental": true enter image description here

Step 3: Restart Docker
enter image description here

Step 4: To install dockerfile is successful( ex: docker build -t williehao/cheers2019 . ) enter image description here

Upvotes: 64

Rohit Tatiya
Rohit Tatiya

Reputation: 471

I have encountered this error when I started learning docker and my understanding of this scenario is below:

why you hit this issue: Because you're referring the image of Linux based and you're currently using windows base platform to run/ build docker image.

Resolution: Short answer: Either switch your current platform to Linux mode or pull the windows based image. Here is the list of possible options:

  1. Switch to Linux Containers as the error is "no matching manifest for windows/amd64"
  2. Set the docker environment "experimental": true.
  3. Pull the image specific to a platform e.g. docker pull --platform {linux/Windows} {image-name}

Upvotes: 5

luis.espinal
luis.espinal

Reputation: 10519

This just happened to me after I upgraded Docker Desktop (previously configured with WSL2 integration.)

In case you ran into this after an upgrade, just FYI that I had to do the following:

Run PowerShell in Administrator (elevated) mode and execute the following commands:

cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon

If you don't do this, you might not be able to open up the Settings tab on Docker Desktop.

Then, you need to switch to Linux Containers in Settings (by unchecking "Use the WSL2 based engine"), then restart.

enter image description here

At this point, just run a quick test that downloads an image and runs a container off it, to see if that solves the issue:

docker run --rm -ti alpine:latest uname -a
Linux 2b08b155a042 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 Linux

From there, if you were running with WSL2 integration, simply go back to the Settings screen and undo the selection we did in step number two (which will restart docker.)

At that point, you will see all images and stopped containers you had prior to the upgrade.

Upvotes: 6

SeyedPooya Soofbaf
SeyedPooya Soofbaf

Reputation: 2649

In Docker:

  1. go to Settings
  2. go to Docker Engine
  3. change experimental to true
  4. press Apply and Restart

.

Upvotes: 9

Jared Zena
Jared Zena

Reputation: 350

I solved this in Windows 10 by running in admin Powershell:

cd "C:\Program Files\Docker\Docker"

And then:

./DockerCli.exe -SwitchDaemon

Upvotes: 24

Legends
Legends

Reputation: 22662

In my case I had to update windows first, after that the problem has gone.

Upvotes: 2

GoYun.Info
GoYun.Info

Reputation: 1366

For me, it is because of access denied to C:\ProgramData\Docker\config\daemon.json After I fixed it now it works. You can try to switch to Linux containers and switch back. If there is no problem with the switching, then it works with the access permission.

Upvotes: 1

Eltomon
Eltomon

Reputation: 364

Deprecating the ‘latest’ tag

We are deprecating the ‘latest’ tag across all our Windows base images to encourage better container practices. At the beginning of the 2019 calendar year, we will no longer publish the tag ; We’ll yank it from the available tags list.

We strongly encourage you to instead declare the specific container tag you’d like to run in production. The ‘latest’ tag is the opposite of specific; it doesn’t tell the user anything about what version the container actually is apart from the image name. You can read more about version compatibility and selecting the appropriate tag on our container docs .

https://techcommunity.microsoft.com/t5/containers/windows-server-2019-now-available/ba-p/382430#

Upvotes: 4

VonC
VonC

Reputation: 1323035

This looks like "docker pull" fails in windows 10 #1100

If adding --experimental does not work, consider re-installing docker for windows.

Upvotes: 8

harun ugur
harun ugur

Reputation: 1852

Right click Docker instance Go to Settings Daemon Advanced Set the "experimental": true Restart Docker

 {
      "registry-mirrors": [],
      "insecure-registries": [],
      "debug": true,
      "experimental": true
    }

Upvotes: 5

Tiago Medici
Tiago Medici

Reputation: 2194

On Windows you must edit the file daemon.json or windows-daemon-options.json, the default location of the configuration file on Windows is %programdata%\docker\config\daemon.json or %programdata%\docker\resources\windows-daemon-options.json

enter image description here enter image description here

enter image description here

enter image description here

The optional field features on the json file, allows users to enable or disable specific daemon features. Example: {"features":{"buildkit": true}} enables buildkit as the default docker image builder.

Upvotes: 1

Udit Gandhi
Udit Gandhi

Reputation: 357

The reason it is showing this message because it is unable to find Linux containers as running. So, make sure you switch from windows to linux containers before running it.

Upvotes: 0

joedragons
joedragons

Reputation: 2645

In my case it was that the Windows OS version I was on did not support the tag I was trying to pull. Utilizing an older tag allowed me to get this to work.

Specifically:

docker pull mcr.microsoft.com/windows/nanoserver:1903 errored

docker pull mcr.microsoft.com/windows/nanoserver:1803-amd64 worked

Upvotes: 78

Sibeesh Venu
Sibeesh Venu

Reputation: 21709

I was getting this error in my Azure DevOps pipeline.

Step 1/7 : FROM nginx:alpine
alpine: Pulling from library/nginx
no matching manifest for windows/amd64 10.0.14393 in the manifest list entries
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
##[section]Finishing: Build an image

The problem was I had selected the Hosted VS2017 instead of the Hosted Ubuntu. After changing the same as follows, the build was successful.

enter image description here

Hope it helps.

Upvotes: 3

Filipe Luchini
Filipe Luchini

Reputation: 361

I had the same problem to run Windows IIS image using docker for Windows. Reading the Mohammad Trabelsi response above I realised that to solve my problem I needed to switch my containers (on docker) for Windows containers.

To do this:

  1. Right click Docker instance
  2. Select "Switch to Windows containers..."

Upvotes: 3

FabianTe
FabianTe

Reputation: 649

This may not only happen due to windows containers!

Today all Node.Js docker images are not pullable. Always check the image you are trying to pull before.

Related Github-Issue

Upvotes: 3

Connor
Connor

Reputation: 31

Consider the applications that you are pulling - are they Windows based? If not, you need to run a Linux container.

Without using the experimental mode, you can only use Docker in one style of container vs the other. If you activate the experimental mode as mentioned above, you can use Windows and Linux containers as required by the applications you are pulling in the compose file.

Key note: Experimental - still in development by Docker.

Upvotes: 3

tomab
tomab

Reputation: 2151

Another possible way to do this:

In system tray, right click on docker icon, then click on Switch to Linux containers.

(Docker for Windows, Community Edition, version 18.03.1)

Upvotes: 40

chuck
chuck

Reputation: 325

You need to pull with the Linux platform first, then you can run on Windows:

docker pull --platform linux php
docker run -it php

See blog post Docker for Windows Desktop 18.02 with Windows 10 Fall Creators Update.

Upvotes: 15

Ahmad Hassan
Ahmad Hassan

Reputation: 1241

You are in Windows container mode. So if you're not sure that the image you want to pull is built for the Windows architecture, you need to switch to Linux containers.

Upvotes: 114

Related Questions