Closed Jaspreetc closed 7 years ago
To @Jaspreetc:
I will be opening a support ticket with Jfrog Artifactory as well
Hi. Was you able to open JFrog Artifactory ticket? I'd like to know ticket ID and link.
To @mabrarov the ticket has been opened but the logs are yet to be updated which may not be before November 7th . in the mean time can you please let me know if docker 1.13 dev has a fall back mechanism to older schema ? I will ping you with the details by November 7 as soon as the logs has been uploaded.
To @Jaspreetc:
can you please let me know if docker 1.13 dev has a fall back mechanism to older schema
Could you share details (steps, what needs to be done, what logs need to be collected) with me (refer to email in my GitHub profile), please? I'm using JFrog Arifactory docker image - web UI of Artifactory reports about 4.14.0 version. I'm also using Windows Server 2016 RTM Standard (the docker host from which I try to push my docker images based on official microsoft/windowsservercore image) with docker (output of docker version
) 1.12.2-cs2-ws-beta.
Docker-registry-0.9.1-7.el7.x86_64
-- this registry is not compatible with schema2 being used by docker.
You need to update your registry version.
Not registry v2 is here: https://github.com/docker/distribution
Thanks @cpuguy83 (Brian) let me give that a try and will get back to you shortly. I am off for a week so it won't be before Nov 10
@mabrarov As soon as I collect the logs with the Jfrog team will let you know more information about it. It will be prolly post my return
@mabrarov At the moment we run into the same problem. I raised a bug on their jira
Let me close this issue here, because this is not a bug in docker, but feel free to continue the discussion.
@cpuguy83 Hi Brian, I have tried the latest version but it still fails with the same error Name : docker-distribution Version : 2.4.1 Release : 2.el7 Architecture: x86_64 Install Date: Thu 18 Aug 2016 11:32:08 AM EDT Group : Unspecified Size : 15789976 License : ASL 2.0 Signature : RSA/SHA256, Mon 25 Jul 2016 02:46:56 AM EDT, Key ID 199e2f91fd431d51 Source RPM : docker-distribution-2.4.1-2.el7.src.rpm Build Date : Sat 25 Jun 2016 05:57:02 PM EDT Build Host : x86-039.build.eng.bos.redhat.com Relocations : (not relocatable) Packager : Red Hat, Inc. http://bugzilla.redhat.com/bugzilla Vendor : Red Hat, Inc. URL : https://github.com/docker/distribution Summary : Docker toolset to pack, ship, store, and deliver content Description : Docker toolset to pack, ship, store, and deliver content
Logs from Docker-Registry
Nov 17 08:05:07
Jfrog accepted the problem and have update it might get fixed in Q2 2017 https://www.jfrog.com/jira/browse/RTFACT-10305
@thaJeztah , I believe its a bug or design change required for Docker, since its not working in Docker Registry Version 2.4.1 as well. If there is a working solution available to push Windows Container images to Private Docker Registry please share, else there is some work required on this to get it fixed.
@Jaspreetc looks like that's not an official version of the registry, but a version packaged by Red Hat. Support for foreign layers was added in version 2.5 https://github.com/docker/distribution/releases/tag/v2.5.0, and is needed for Windows based images because the base layers are only allowed to be distributed by Microsoft (for legal reasons). When pushing an image based on those images, only your layers will be pushed to the registry, but the base layer is not pushed (a reference to the foreign location is included in the image's manifest).
To run the current version of the registry, you can use the official image; https://github.com/docker/docker.github.io/blob/master/registry/deploying.md
@thaJeztah Thanks it was downloaded from https://github.com/docker/distribution. Let me try the newer version and get back to you. Thanks for your valuable input appreciate your quick response.
@thaJeztah I deployed the registry "https://github.com/docker/distribution/releases/tag/v2.5.0,",yesterday but it fails to run I get the following error , either there is an issue with the way I have deployed registry or there is something wrong with the image, I have tried it on 2 different machine and have the same result.
[root@
@Jaspreetc did you build that image yourself or pull it from Docker hub? The image you showed is 289MB, but the official image is only 10MB (compressed, uncompressed +/- 33MB)
What happens if you simply run the official image from Docker Hub?
docker pull registry:2.5
docker run -it -p 5000:5000 --restart=always --name registry registry:2.5
@thaJeztah I downloaded the source code and build the container image, the same thing was done for 2.4.1 and it was working.
Let me try the steps you have requested and would get back to you on Monday. if that does not work I will try 2.5.1 or 2.6.0 Rc1 as well.
Building from GitHub works for me as well (although you'd get a much larger image, as it's meant for development, not for "production", so not a minimal image);
docker build -t registry:v2.5.0 github.com/docker/distribution#v2.5.0
Sending build context to Docker daemon 18.92 MB
Step 1 : FROM golang:1.6-alpine
1.6-alpine: Pulling from library/golang
...
...
Successfully built bea1acc7f1ea
docker run -it --rm -p 5000:5000 --name registry registry:v2.5.0
INFO[0000] debug server listening localhost:5001
WARN[0000] No HTTP secret provided - generated random secret. This may cause problems with uploads if multiple registries are behind a load-balancer. To provide a shared secret, fill in http.secret in the configuration file or set the REGISTRY_HTTP_SECRET environment variable. environment=development go.version=go1.6.3 instance.id=5f0ea88c-15df-4b94-8d04-243f9a6458f4 service=registry version=v2.5.0
(same for v2.5.1)
@thaJeztah Thanks that worked, but I am curious as to why do I need to get onto internet every time if I have to download the Windows container image, even when I have downloaded it once into my environment, doesn't it defeat the purpose? why can't I reference it to the downloaded image , since not all servers would have access to internet. If this would be the case then it would be difficult to pull the image on new servers and that was the whole reason for registry to be in place correct?
@Jaspreetc How exactly do you mean "why do I need to get onto internet every time if I have to download the Windows container image"? If you docker pull <some-windows-image>
and then docker run <some-windows-image>
does it try to pull the image each time?
@thaJeztah
Server 1 – Windows Container image downloaded from Docker hub Server 2 – Image Pushed to Docker registry , but only the latest digest goes on to the registry and the foreign layers are skipped
C:\Windows\system32>docker push xxx.xxx.xxx.xxx:5000/windowsservercore The push refers to a repository [xxx.xxx.xxx.xxx:5000/windowsservercore] b9454c3094c6: Skipped foreign layer 3fd27ecef6a3: Skipped foreign layer latest: digest: sha256:571381e3e11fb93ba128adbdcaeb354cb6a470ee60919b89627731361b021d6e size: 943
Server3 Docker pull xxx.xxx.xxx.xxx:5000/windowsservercore ( docker registry)
time="2016-11-21T08:45:42.009251300-08:00" level=debug msg="pulling blob \"sha256:d33fff6043a134da85e10360f9932543f1dfc0c3a22e1edd062aa9b088a86c5b\"" time="2016-11-21T08:45:42.009251300-08:00" level=debug msg="pulling blob \"sha256:9c7f9c7d9bc2915388ecc5d08e89a7583658285469d7325281f95d8ee279cc60\"" time="2016-11-21T08:45:42.010254400-08:00" level=debug msg="Pulling sha256:d33fff6043a134da85e10360f9932543f1dfc0c3a22e1edd062aa9b088a86c5b from foreign URL https://go.microsoft.com/fwlink/?linkid=834677" time="2016-11-21T08:45:42.012253300-08:00" level=debug msg="Pulling sha256:9c7f9c7d9bc2915388ecc5d08e89a7583658285469d7325281f95d8ee279cc60 from foreign URL https://go.microsoft.com/fwlink/?linkid=830340" time="2016-11-21T08:54:53.022940200-08:00" level=debug msg="Downloaded d33fff6043a1 to tempfile C:\Users\ADMINI~1\AppData\Local\Temp\2\GetImageBlob260816119"
It detects the foreign layers and pulls the blob & image from Microsoft site, it defeats the purpose of registry
Yes, the foreign layers will always be pulled from the Microsoft servers (however, once they're in the cache of that server, it will use the ones that are cached locally).
Unfortunately, that's for legal reasons; the base layers are not allowed to be distributed through other servers. I don't know if there's exemption from this, but I don't think there are.
@thaJeztah
doesn't it sounds obscure to download roughly 4-5 gig of image via internet on each and every Container host which may be in hundreds? Microsoft has to come up with something better alternatives cause this doesn't seems to be a viable solution for each pull from registry :( .. is there a way to raise a request to change this feature, at least where the image will be made available offline like they do on WSUS for patches which can then be locally pulled over intranet
@Jaspreetc this was the best that could be realized; previously, the base layer had to be manually installed on each host. @jhowardmsft or @jstarks may know if future changes are still possible.
@Jaspreetc this was the best that could be realized; previously, the base layer had to be manually installed on each host. @jhowardmsft or @jstarks may know if future changes are still possible.
Leaving this one for @patricklang. This isn't really a technical question requiring a code change to docker.
@Jaspreetc you're ok to push the foreign layers to your own private registry, as long as you don't redistribute them publicly (this is the equivalent of storing a Windows ISO on a private server).
Unfortunately, the Docker distribution source code does not currently have a way to force-push foreign layers, but we're exploring workarounds.
An alternative approach (that I don't know whether works in your scenario) is to pre-load base layers to whatever server or OS image that you use when setting up new machines. That way, docker-enabled servers will have the relevant base layers when they're brought up.
cc @dmp42 @stevvooe
@jhowardmsft Thanks John @friism - the alternative approach will work only for the initial pull, but the cycle has to repetitive with Windows container image updated every month that makes thing trickier. A thought if we can explore onto modifying the part where it calls the foreign layer to be downloaded from Microsoft to local intranet; provided the blob/digest and SHA1 are intact even when the link location changes.
@dmp42 @stevvooe
@Jaspreetc yeah, I also tried just modifying the JSON in the image tarball to remove the foreign layer references. The bits are there on disc so it seems like that should work, but I haven't been successful pushing foreign layers to private repo yet.
Alright, here's what you can do as a workaround:
manifest.json
and remove the LayerSources
stuffmanifest.json
-g
set to non-standard locationdocker load -i image.tar.gz
into that fresh Docker engine (eg. use -H
to point at it)docker tag <your-favorite-foreign-layer-image> <private-repo-tag>
docker push <private-repo-tag>
This is obviously not great, but should work as a workaround.
@friism Thanks Michael, let me give it a try for the kick start, I still believe there is a need to permanently fix this for ease of operation.
@friism That did work as a workaround. Thanks
@thaJeztah can I suggest that this issue be re-opened? I think it's a missing feature that there's no way to force-push foreign layer to private registries.
I was chatting with @friism in the other bug - I don't know what to make of all these comments being not a docker dev but this is the situation I brought up to ask for a re-open.
I have a windows build server building my docker images. I then have a production environment of 4 machines which I want to run those images on.
In TP5 I was able to push images from the build server to a private repository and start these images in the production environment by pulling from that repository.
This process doesn't work anymore in GA and is a blocking issue for us. All I'm asking for is a way to get an image built on a foreign machine onto a production machine without untarring and modifying manifests as above.
For right now the only way I know to do this is to transfer the complete docker build to each production server and do docker build [image] .
4 times.
@volak out of curiosity, are you pushing to a private docker/distribution
registry that you're running? Foreign layers should work with that, although they'll be situated on Docker Hub.
@friism Yes I am running registry:2 in my own environment. But I get the same issue as everyone else
I think foreign layers issue is fixed post 2.5 and it does not work in 2.0
Registry:2.5 or 2.5.1
Yep! Switching to registry:2.5.1 allows me to push windows images again! Theres still a small issue that the image has to be tagged with port :443 otherwise docker complains about unknown ssl authorities but I think thats something I should be able to figure out. Thanks
@friism Hey Michael, with this issue being reopen , when are we expecting the changes to be in effect to force the foreign layer images to be pushed to registry. I understand there might quite a code change required but wanted to know if there can be an ETA for this.
@friism Hi Michael, am trying a docker save -o c:\docker\images\
@arthi-ramachandran recommend opening task manager and sorting processes by disk i/o - it should be writing to disk
@friism Hey, same issue here, is there a workaround for pushing images to private repo(Jfrog Artifactory) with a manifest being generated? I keep getting manifest invalid and then can't pull that image from my repo?
@kenchenaz There is an issue with Jfrog, please check with Jfrog, they were supposed to fix this by Dec 2016
@jstarks with your experience from building the original foreign layer implementation, I wanted to ask if you had time to implement an override switch that would let users force push foreign layers to private registries?
cc @aaronlehmann @dmp42 @vsaraswat
@friism , that will be really useful
I wanted to ask if you had time to implement an override switch that would let users force push foreign layers to private registries?
If we add this flag, why have foreign layers at all?
why have foreign layers
@stevvooe this is so that when Windows images are distributed publicly, the Windows base layers can be distributed by Microsoft. Once the flag is added, base layers are distributed by Microsoft for public images on Docker Hub and by default also for Windows images hosted in private repos. But for Windows images in private registries, there's an additional option to push and store the Windows base layers in the private registry.
If we add this flag, why have foreign layers at all?
There are some scenarios (such as air gaps) where it may not be possible or efficient to retrieve layers from central servers. I feel we should allow users to push foreign layers in these exceptional circumstances, rather than being coercive. What's most important with foreign layers is not to push them by default, to avoid unintentional copyright infringement. However, it should ultimately be the user's decision, with our guidance, on how to handle them.
As per Windows licensing terms and the supplemental EULA for container images (https://docs.microsoft.com/en-us/virtualization/windowscontainers/images-eula and/or licence.txt file in each image) customers are permitted limited redistribution rights. Specifically, they can push base images to their own repositories for distribution to their own hosts. We specifically added this clause to address air-gap scenarios but we need to ensure that a user does not unknowingly push an image to a public repro thus publicly distributing Windows.
@friism I'm supportive of such a change, with the caveat that the private registry needs to preserve the foreign layer metadata. We must ensure that a foreign layer pulled from a private registry cannot be pushed to a public registry (or other registry that doesn't accept foreign layers).
However, I don't think I'll have time to tackle this for a while. If someone else has time, I'm happy to review the changes.
I feel we should allow users to push foreign layers in these exceptional circumstances, rather than being coercive.
It seems that these circumstances are not exceptional. This sounds like the norm for working with Windows images on premises. We should make a regular user work flow that doesn't accuse the user of piracy or end up with a user just using a flag they don't understand. Both result in accidental misunderstanding that can affect workflow.
Can we figure out a way to make this work so that users don't blindly add this flag to every docker pull
command because they only understand "I need this to make it work"?
However, it should ultimately be the user's decision, with our guidance, on how to handle them.
Agreed, but foreign layers were never meant to be a part of the UX. It opens up too many questions. These issues have already come up in other PRs and issues and there doesn't seem to be a plan to address them. Once you have a flag that says "go head and push foreign layers", at what point do you create a feature to craft them? When everyone is crafting these layers, how do you maintain the user experience?
We can completely avoid this issue by automating the behavior with private registries or possibly warning the user they are about to distribute something that may have restrictions.
we need to ensure that a user does not unknowingly push an image to a public repro thus publicly distributing Windows.
Let's make sure that is the narrow requirement. I think we can make a limited feature that solves this issue without introducing a flag or the concept of "foreign layers" to users.
Description
Failed to upload schema2 manifest: manifest invalid: manifest invalid
Briefly describe the problem you are having in a few paragraphs.
I am trying to push Windows Container image to Jfrog Artifactory Docker Registry it fails with an error “failed to upload schema2 manifest “
Similar thing happens when I try to push an image to Docker private Registry it fails with an error “manifest blob unknown: blob unknown to registry”
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected: Successful upload the image to repo
Additional information you deem important (e.g. issue happens only occasionally): Dockerd 1.12 & 1.12.2 also have this issue.
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.): Artifactory Enterprise : 4.9.0 rev 40226 Docker Registry version: Docker-registry-0.9.1-7.el7.x86_64
I will be opening a support ticket with Jfrog Artifactory as well, but wanted to check with the newer version of Dockerd engine will the schema version will always be on version 2 or will there be a fallback to version 1 or if this is a bug in docker ?