-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker load fails on Windows #2732
Comments
@rancher-max @phillipsj what tool do y'all usually use to load the tarballs into your registry for airgap testing? |
I've only used the tarball when doing it in airgap, so I just use I haven't had to use |
My goal is to store the Windows images in a Docker v2 registry, so I can avoid preloading the images on the Windows nodes in Essentially the "Private Registry Method" from Windows Air-Gap docs. As I understand this document I can use a Windows system with Windows Docker EE installed, import the RKE2 windows images from the tar.gz using The fallback would be the Windows Tarball Method, which requires me to copy the tarball onto each Windows node. |
We use crane to build the windows image tarballs, you might consider using the same to copy them into your private registry. Docker does a poor job of managing images if they're not for the same platform it's running on. rke2/scripts/package-windows-images Lines 10 to 14 in abd8fd3
|
Ahh I see, yeah in that case, I still haven't messed with the docker load bit. I've hosted my private registry on a linux machine (so that I could use it for both the linux server and windows worker nodes). The two images you need (from https://github.com/rancher/rke2/releases/download/v1.23.5%2Brke2r1/rke2-images.windows-amd64.txt) are:
I was able to get
For the other image, I did have to use crane:
Unfortunately I'm not 100% sure how to properly setup a windows-only registry, but hopefully this helps you 🤞 |
Thanks for the hint, it helps me understand the anatomy of these images. But I don't think that I can use crane to use the windows image tarball provided in the RKE2 GitHub release. My hope still is that I can just grab the tarball and do not have to create a tarball myself (with an online Windows Docker EE node). Podman?Before creating the issue I already tried Podman!I didn't see that coming (notice the IDs 197108:197121, >65535), but it works with modified ID ranges: $ cat /etc/subuid /etc/subgid
jw:100000:200000
jw:100000:200000
$ podman system migrate
$ ➜ podman load -i airgap_files/rke2-windows-1809-amd64-images.tar.gz
Getting image source signatures
Copying blob 9bbd1b662743 skipped: already exists
Copying config 184980b2fb done
Writing manifest to image destination
Storing signatures
Getting image source signatures
Copying blob 4beae82b9843 skipped: already exists
Copying blob c943530b8211 skipped: already exists
Copying blob 90dbf06ef6a5 skipped: already exists
Copying blob f186d149a4b1 skipped: already exists
Copying config 9af01c3cdd done
Writing manifest to image destination
Storing signatures
Loaded image(s): docker.io/rancher/rke2-runtime:v1.23.5-rke2r1-windows-amd64,localhost/rancher/pause:3.6-windows-1809-amd64
# no complaints about OS :^)
$ podman inspect docker.io/rancher/rke2-runtime:v1.23.5-rke2r1-windows-amd64 localhost/rancher/pause:3.6-windows-1809-amd64 -f "{{.Os}} - {{.RepoTags}}"
linux - [docker.io/rancher/rke2-runtime:v1.23.5-rke2r1-windows-amd64]
windows - [localhost/rancher/pause:3.6-windows-1809-amd64] Notice how the runtime image is identified as linux and the pause image as windows. Now the interesting part, pushing to my registry (docker.io/_/registry:2 on RHEL Docker CE):
Looks good, image was pushed to registry. Verifying that with skopeo:
Good news. I'll test if I can deploy RKE2 on the Windows Server VMs with these images. Looking back at my initial issue it's now clear why docker load failed on Windows and Linux Docker. Docker accepts only images that match the OS it's running on. The tarball has both a Windows and Linux image inside, at least this is what Podman and Skopeo tell me. Convince yourself: |
Yes, that's correct. And why I suggested using crane to copy the images from the tarball to your remote registry. I believe it should be capable of that. |
@brandond: I did not find a subcommand of crane that accepts the tarball from RKE2 releases (rke2-windows-1809-amd64-images.tar.gz) as input and the docker registry as destination. What it seems to do is copy images from one registry to another registry (crane copy), copy images from a registry to a tarball (crane pull) or push an OCI image directory to a registry (crane push).
I can confirm that Windows Node setup works after copying the images to a private registry with skopeo. Configuration used:
My Windows Server VMs have no way to connect to the internet, so they certainly only use the rke2 binary and the images from the local registry. I think that the documentation should provide accurate instructions to use the tarball to fill a private registry. The podman method worked for me. Could this method be included in the documentation? I suggest to keep this issue open to resolve this. |
Hmm, that is interesting. I personally like skopeo a lot, in preference to crane or podman, but I'll defer to the Windows team on what tool they want to suggest for use. |
I personally think it might be good here to be tool-agnostic. Mention that skopeo, podman, and crane have all been proven to work for this but users can use whichever tool they like that works to "copy images that have a set OS to your registry" and that docker load as of the time of the writing explicitly does not work. |
To summarize my observations about the potential tools to push RKE2 image tarballs (e.g.
There are some other tools that weren't mentioned here yet. |
@jwhb thanks for that summary. We have an issue opened for the docs team to update with some guidance on the topic. I really like skopeo too and its interesting that skopeo sync doesn't support tarballs. |
@phillipsj: I can elaborate on why it's not working out of the box with skopeo. naive approach:
You can specify the index of an image in a docker-archive/tarball with
So RepoTags are lost, but we can read individual images if we know their index. Now You might be able to combine that with this new feature: containers/skopeo#1581 Maybe I'm just missing a command flag somewhere. 🤔 |
It'd be nice if skopeo would just copy all the images in the tarball without having to pick them out individually. |
Environmental Info:
RKE2 Version: v1.23.5+rke2r1
Node(s) CPU architecture, OS, and Version:
Windows Server 2019 Datacenter Version 1809 (Build 17763.2686), amd64
Cluster Configuration:
No cluster yet, goal is cluster with Windows nodes.
Describe the bug:
Followed RKE 2 Windows Air-Gap Install - Private Registry Method:
When loading the image archive into Windows Docker EE (actually Mirantis CR) with
docker load -i rke2-windows-1809-amd64-images.tar.gz
,Docker CLI reports
unsupported os linux
.Docker CE on Ubuntu WSL rejects the very same windows images tar.gz file with the same error message. It seems that
rke2-windows-1809-amd64-images.tar.gz
is not compatible withdocker load
in Docker CE for Linux and Docker EE for Windows.Steps To Reproduce:
rke2-windows-1809-amd64-images.tar.gz
from latest release to Windows Server with Docker EEdocker load -i rke2-windows-1809-amd64-images.tar.gz
Expected behavior:
Windows Docker EE loads the images from RKE2 release tar.gz.
Actual behavior:
Error message:
unsupported os linux
.Additional context / logs:
On WSL Ubuntu with Docker:
The text was updated successfully, but these errors were encountered: