After install docker v1.12.0-rc2 on windows 10 pro machine, set the http and https variables, i get the following error:
docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error while pulling image: Get https://index.docker.io/v1/repos
itories/library/hello-world/images: x509: certificate is valid for FG200B3911602237, not index.docker.io.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
world image is images for Linux container, you can't use it on windows container.
At the moment, there're only about 9 or 10 images for windows containers, you can use it follow this article https://msdn.microsoft.com/en-us/virtualization/windowscontainers/deployment/deployment.
After install v1.12.0-rc3-beta18 build 5226 pull container works behind a proxy. tks #huy-tran
Related
I want to create a Docker Image that can be hosted on Azure App Services for Windows. My application is based on ASP.NET Core 2.1 and according to the official list of .NET images images, I should be able to simply use microsoft/dotnet:2.1-aspnetcore-runtime.
I can build the Dockerfile on a Windows machine successfully and was able to run it there without issues. But after uploading it to Docker Hub and setting it as the App Service's Docker Image, I get the following error message:
Cannot run this Operating System/Version in Windows Containers.
Maximum supported OS version is 10.0.14393.9999.
According to the Azure App Services Documentation, it should support the microsoft/dotnet:2.1-aspnetcore-runtime as one of the pre-installed parent images.
When inspecting my Docker Image, I found, that the used image seems to be too new for Azure App Services:
"Architecture": "amd64",
"Os": "windows",
"OsVersion": "10.0.17134.285" <-- too new
After some research, I found in this blog post, that Azure App Services on Windows might only accept microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016 image. So I tried to rebuild the Docker Image with these.
This time, the App Service accepted the image, but was unable to start it, throwing the following logs:
02/10/2018 14:15:09.437 ERROR - Site: rothiewindockerdemo - Image pull reported error. Image: robinmanuelthiel/contosomaintenance-api:latest-windows-sac2016. failed to register layer: re-exec error: exit status 1: output: remove \\?\C:\DockerData\windowsfilter\93b716197958ceb58006ff3d978fcb3202f7866d00d6d8d69513cf0478a17a7f\UtilityVM\Files\Windows\servicing\Packages\Microsoft-UtilityVM-Core-Package~31bf3856ad364e35~amd64~~10.0.14393.0.cat: The process cannot access the file because it is being used by another process.
02/10/2018 14:15:09.437 INFO - Site: rothiewindockerdemo - Image: robinmanuelthiel/contosomaintenance-api:latest-windows-sac2016
Custom Registry: https://index.docker.io
02/10/2018 14:15:09.439 ERROR - Site: rothiewindockerdemo - Pull image completed but it was not found locally. Image: robinmanuelthiel/contosomaintenance-api:latest-windows-sac2016
02/10/2018 14:15:09.441 WARNING - Site: rothiewindockerdemo - Attempt 1 to start container was unsuccessful. Maximum attempts: 3.
02/10/2018 14:15:09.568 INFO - Site: rothiewindockerdemo - Purging after container failed to start
02/10/2018 14:15:09.582 INFO - Site: rothiewindockerdemo - Purging pending logs after stopping container
So what is the correct Windows Docker Base Image for ASP.NET Core 2.1 Docker Containers on Azure App Services?
That's my Dockerfile:
#######################################################
# Step 1: Build the application in a container #
#######################################################
# Download the official ASP.NET Core SDK image
# to build the project while creating the docker image
FROM microsoft/dotnet:2.1-sdk as build
WORKDIR /app
# Restore NuGet packages
COPY *.csproj .
RUN dotnet restore
# Copy the rest of the files over
COPY . .
# Build the application
RUN dotnet publish --output /out/ --configuration Release
#######################################################
# Step 2: Run the build outcome in a container #
#######################################################
# Download the official ASP.NET Core Runtime image
# to run the compiled application
FROM microsoft/dotnet:2.1-aspnetcore-runtime
WORKDIR /app
# Open HTTP and HTTPS ports
EXPOSE 80
EXPOSE 443
# Copy the build output from the SDK image
COPY --from=build /out .
# Start the application
ENTRYPOINT ["dotnet", "MyApp.dll"]
The issue lies in the fact that microsoft/dotnet:2.1-aspnetcore-runtime is a multi-architecture base image. This means that Docker build will pick the best architecture for your local machine (the machine where you are building your docker image). I assume that your local machine is Windows 10 April 2018 Update (Version 1803 - Whose build number 17134.407). As of now, we only support images based off of Windows Server 2016 (Version 1709, up to build number 14393.XX).
In order to “force” a specific version, please use this base image instead: microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016. You can check all the available tags in https://hub.docker.com/r/microsoft/dotnet/
We will work on calling this out specifically in our documentation.
Is important to mention that Windows Containers on App Service is currently in Preview.
The validation on the portal "Cannot run this Operating System/Version in Windows Containers. Maximum supported OS version is 10.0.14393.9999." is shown because we are running the servers with Windows Server 2016 RS1 and currently can't run containers for RS3+. We are currently working on enabling them, but we don't have an ETA to share at this point.
If the validation passes, it means that the specified image should work fine and the issue you are seeing is not directly related to the image. It is a bug in the platform and it seems similar to the issue reported here: https://github.com/Microsoft/hcsshim/issues/155
We will continue investigating and thanks for reporting the issue
The answer above that was marked as an answer is not correct. It leads you to believe that using microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016 will solve your problems, but it won't. I tested this on Azure Container instances, and it does not work.
The solutions is this: when you get OsVersionNotSupported it means that the image was create with windows version that is not supported, and Microsoft currently does not support any SAC versions (SAC is Semi-Annual Channel). So versions like 1709 and 1803 will NOT WORK. Also the "solution" above is not going to work, since it uses that tag of SAC2016.
For all tags that you can use in docker file, go here: https://github.com/dotnet/dotnet-docker/blob/master/TAGS.md
You need to go to https://learn.microsoft.com/en-us/azure/container-instances/container-instances-troubleshooting and read the section "OS version of image not supported". It clearly states that you need to "...always deploy Windows Server 2016 (LTSC)-based images...".
I'm trying to pull a simple hello-world image from docker hub using :
docker run hello-world
But I'm getting this error on Windows 7 :
Unable to find image 'hello-world:latest' locally
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Get https://registry-1.docker.io/v2/: authenticationrequired.
I've tried so many different things but none seem to work :
1 - I tried logging in, but I'm getting the same error :
docker login
Tried my username, my email ... Same error :
Error response from daemon: Get https://registry-1.docker.io/v2/: authenticationrequired
2 - Restarted docker machine, same error.
3 - Reinstalling Docker and Oracle VirtualBox multiple times
4 - Done all the steps here : https://github.com/docker/kitematic/wiki/Common-Proxy-Issues-&-Fixes
I really don't know how to fix this anymore.
I had this problem when I tried to login to the docker behind a corporate proxy. Are you in a similar situation? If so, see if you add "https://registry-1.docker.io/v2/" to the exemption list for proxy's HTTPS analysis.
If you are not behind a proxy, check to see if you have any software that do a HTTPS analysis. Sometimes software like Fiddler or Antivirus does that. If you found anything like that see if you can whitelist the url
Hope it helps. I had a hard time figuring this out for my issue
I wanted to pull the the Docker image for Windows core/nano, docker pull microsoft/xxx to my local computer. The pull starts but it quickly ends with the error unknown blob
Same result for both of these:
PS C:\>docker pull microsoft/nanoserver
PS C:\>docker pull microsoft/windowsservercore
When trying to use images from Microsofts Docker repository "microsoft/xxx" you must ensure that you are running Docker with Windows containers, not Linux containers.
https://learn.microsoft.com/sv-se/virtualization/windowscontainers/quick-start/quick-start-windows-10
I have installed docker toolbox for Windows 7 64 bit system. I am getting following error while executing 'docker run hello-world' command .
Please guide me to resolve this.
Thanks in advance!
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pulling fs layer
C:\Program Files\Docker Toolbox\docker.exe: error pulling image configuration: G
et https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha
256/48/48b5124b2768d2b917edcb640435044a97967015485e812545546cbed5cf0233/data?Exp
ires=1484910885&Signature=DsT7p2RzmUsymlHz2qG51UJspf9ZvTvHF2pjxJPEi1~c9SomNSk2dv
Sqn1UEpsuse3iVmkq37HKT7cEvRaPsu5vB1RlHBgUg6FJB0DGukLBIq1t2hddVPvlI4Q7lm5B5j3NzRI
vj-hYXrAYDxKAM3TX6LsIdrSrmTHlyIZJ4~1A_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: read tc
p 10.0.2.15:40664->52.222.190.31:443: read: connection reset by peer.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.
Thats a connection issue. Try using a different internet connection or using a vpn or an http proxy.
Whitelisting DockerHub's IPs:
Docker Hub doesn't have static IP that can be whitelist. Docker Hub is based on Amazon ELB, so they can change any time.
You can do the following and add a subset of ips, May work for you for a short period of time.
dig +noall +answer index.docker.io
;; ANSWER SECTION:
index.docker.io. 174 IN CNAME elb-io.us-east-1.aws.dckr.io.
elb-io.us-east-1.aws.dckr.io. 465 IN CNAME us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com.
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 174 IN A 52.200.132.201
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 174 IN A 52.45.107.172
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 174 IN A 52.22.146.88
On windows, try nslookup.
I have been experimenting with docker the aim is
Install docker on windows 16
for which I am following instructions from https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_server
everything looks fine till installation of the docker , after that when I try to test the docker it give
below error.
failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer C:\ProgramData\docker\windowsfilter\0c9
effd422805350acb1f051eb171399678aff003192c41be274acc4762b786c: The system cannot find the path specified.
here I am just trying to pull "hello-world" from docker hub
My ultimate aim is to run IIS on docker container and deploy the application running on IIS.
Had anyone faced such issue or could come up with any suggestions
its VM machine with
OS :- Win2016
HDD :- 50GB
RAM :- 4GB
You can't pull the hello-world image from docker hub because it's linux image. I used to see it before while playing with Docker Container on windows when trying to do the same thing.
If you want to get different image like IIS, just run command follow the instructions:
First:
Install-PackageProvider ContainerImage -Force
Then
Install-ContainerImage -Name WindowsServerCore
After that, restart your docker container with
Restart-Service docker
And you'll have the images of IIS on your machine.
I've tried to get the images of windows as the way we do in Linux but it always throw error as you have, I guess that all images we have on hub now are for Linux only, so if you want to have particular things, you must build it by yourselves or using existed images for Windows on Docker hub (about 9 or 10 images as I remember).
This is probably because there's no hello-world image for Windows. You can try running docker run windowsservercore cmd /C hello world.