docker / labs

This is a collection of tutorials for learning how to use Docker with various tools. Contributions welcome.
Apache License 2.0
11.53k stars 5.3k forks source link

MultiContainerApp Lab: getting "Unable to load the service index" error #232

Open dtma007 opened 7 years ago

dtma007 commented 7 years ago

Which lab is it that you're having issues with? https://github.com/docker/labs/blob/master/windows/windows-containers/MultiContainerApp.md

Description The lab is failing for me on this step: docker-compose -f .\docker-compose.windows.yml build

Error

Unable to load the service index for source https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json. [C:\MusicStore\samples\MusicStore\MusicStore.csproj

Steps to reproduce the issue, if relevant:

  1. Follow the step from the lab: https://github.com/docker/labs/blob/master/windows/windows-containers/MultiContainerApp.md

Describe the results you received: On Step 9, I got this error:

Step 9/15 : RUN dotnet restore --runtime win10-x64 .\samples\MusicStore
 ---> Running in 41f846f11c2a
  Restoring packages for C:\MusicStore\samples\MusicStore\MusicStore.csproj...
C:\Program Files\dotnet\sdk\1.0.1\NuGet.targets(97,5): error : Unable to load the service index for source https://dotnet.myget.org/F/aspnetcore-
ci-dev/api/v3/index.json. [C:\MusicStore\samples\MusicStore\MusicStore.csproj]
C:\Program Files\dotnet\sdk\1.0.1\NuGet.targets(97,5): error :   An error occurred while sending the request. [C:\MusicStore\samples\MusicStore\M
usicStore.csproj]
C:\Program Files\dotnet\sdk\1.0.1\NuGet.targets(97,5): error :   The operation timed out [C:\MusicStore\samples\MusicStore\MusicStore.csproj]
ERROR: Service 'web' failed to build: The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';
 dotnet restore --runtime win10-x64 .\samples\MusicStore' returned a non-zero code: 1

Describe the results you expected: I expected the command to run successfully.

Additional information you deem important (e.g. issue happens only occasionally): I also occasionally got another timeout error on earlier steps of the same command (for example on step "COPY version.props ."). However, with re-running, this error will go away.

ERROR: Service 'web' failed to build: hcsshim::PrepareLayer failed in Win32: This operation returned because the timeout period expired

Output of docker version:

Client:
 Version:      17.03.1-ee-3
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   3fcee33
 Built:        Thu Mar 30 19:31:22 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.03.1-ee-3
 API version:  1.27 (minimum version 1.24)
 Go version:   go1.7.5
 Git commit:   3fcee33
 Built:        Thu Mar 30 19:31:22 2017
 OS/Arch:      windows/amd64
 Experimental: false

Output of docker info:

Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 10
Server Version: 17.03.1-ee-3
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.693.amd64fre.rs1_release.161220-1747)
Operating System: Windows Server 2016 Standard
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 31.96 GiB
Name: dm-bm-win2016-1
ID: YJZ5:RFM3:UEGI:B2YG:VSAJ:YVLE:ULVI:YVQO:HCXV:ZVH6:W353:7KJW
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8

Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.): Reproduced on multiple Windows 2016 machines 1) Windows 2016 Server (VM on SoftLayer) 2) Windows 2016 Server (Bare metal machine on SoftLayer)

dtma007 commented 7 years ago

This might be caused by Docker container network issue.

I've been experimenting more with this by commenting out the section of the "Dockerfile.windows" where the failure was occurring. (eg. "RUN dotnet restore --runtime win10-x64 .\samples\MusicStore") After the docker image was created, I started the container "docker run -it dotnetmusicstore_web powershell".

I noticed that from within the container, I cannot ping outside (eg. "ping google.com" or "ping 8.8.8.8")

I'm still not sure why networking would not work though.

]

 docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
a24abce6fc4d        nat                 nat                 local
2a89a18476aa        none                null                local