When using Windows-2019
hosted agent (Agent installed with 1809 windows version -Microsoft Windows Server 2019 Datacenter) as Agent Specification, We can't pull mcr.microsoft.com/windows:2004
docker image.
Exception:
I'm familiar with this solution (Which works perfectly locally). But, since Docker Desktop doesn't install on the agent I can't switch to Windows containers. Moreover, Install Docker Desktop is not an option since reboot required.
Currently, Creating a build machine is not an option.
So my question is: There is a way to pull mcr.microsoft.com/windows:2004
docker image from the hosted agent?
I am afraid there is no such way to pull
mcr.microsoft.com/windows:2004
docker image from the hosted agent.That because Matching container host version with container image versions:
In other words, Windows requires the host OS version to match the container OS version. If you want to run a container based on a newer Windows build, make sure you have an equivalent host build. Otherwise, you can use Hyper-V isolation to run older containers on new host builds.
So, we could not pull the image
windows:2004
(2004
) from the hosted agentwindows-latest
ORwindows-2019
(1809
). We could only pull the imagewindows:1809
with the hosted agent.However, if I pull the image
windows:1903
with hosted agent, I will get the errorno matching manifest for windows/amd64...
. In order to verify my answer, I use the private agent, which hosted on the windows version1903
(OS build18362
), It works fine.In summary, we cannot pull windows:2004 (2004) image on the hosted agent (1809). The workaround for this request is that use the private agent.
BTW, I have tested those solutions which mentioned in the link in your question with private agent. Neither
switch to Linux containers
norset the "experimental": true
can solve this error.The Reference links:
List of Microsoft Windows versions
Unable to pull images from microsoft