3

Getting below error while running container in windows 11. Hyper-V is enabled.

Keeping XM Cloud base image up to date
Error response from daemon: Get "https://scr.sitecore.com/v2/": context deadline exceeded
Building containers...
WARNING: The SITECORE_XmCloud_dot_TenantId variable is not set. Defaulting to a blank string.
solr uses an image, skipping
mssql uses an image, skipping
mssql-init uses an image, skipping
solr-init uses an image, skipping
traefik uses an image, skipping
Building cm
Sending build context to Docker daemon  11.26kB
Step 1/8 : ARG PARENT_IMAGE
Step 2/8 : ARG SOLUTION_IMAGE
Step 3/8 : ARG TOOLS_IMAGE
Step 4/8 : FROM ${TOOLS_IMAGE} as tools
Get "https://scr.sitecore.com/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
ERROR: Service 'cm' failed to build : Build failed
C:\Hori\XMCloud\xmcloud-foundation-head-staging\up.ps1 : Container build failed, see errors above.
At line:1 char:1
+ .\up.ps1
+ ~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,up.ps1

2 Answers 2

0
  1. Try out WAIT_HOSTS option where you can add the list of services that the concerned service depends on in the docker-compose.yml. This is added in the docker compose file within the environment section and this helps with fixing the issue.

    When docker-compose is started (or Kubernetes or docker stack or whatever), your application will be started only when all the pairs host:port in the WAIT_HOSTS variable are available. The WAIT_HOSTS environment variable is not mandatory, if not declared, the script executes without waiting.

    To make your docker application container wait for multiple hosts, the environment variable can be specified as for example WAIT_HOSTS=mssql:14330, xconnect: 8081

  2. Quit Docker Desktop and then run it again.

Reference for more details:

  1. Fix for Service context deadline exceeded issue while docker-compose up for Sitecore 10
  2. Docker Context Deadline Exceeded error | Troubleshooting Tips

Hope it helps!

1
  • Thank you. I tried all steps mentioned above but still issue is not resolved.
    – Akash S
    May 8, 2023 at 10:34
0

Basically I was getting error because Docker Desktop could not reach the internet.

Got to this conclusion after running below command from Run your first Windows container which also gave same error message.

docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022

Resolve the issue by setting InterfaceMetric lowest to 'Wi-Fi' in Network connection by below commands as mentioned in https://github.com/docker/for-win/issues/2760#issuecomment-430889666

Get-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -Descending

Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -InterfaceMetric 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.