Skip to content

Instantly share code, notes, and snippets.

@ipanova
Created July 21, 2021 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipanova/fb2d6806442cd3a85c68570623750879 to your computer and use it in GitHub Desktop.
Save ipanova/fb2d6806442cd3a85c68570623750879 to your computer and use it in GitHub Desktop.
skopeo-copy for air-gapped env
1. login to the PUlp container registry and push images
podman push localhost:24817/test/repo --tls-verify=false
Getting image source signatures
Copying blob 5b8c72934dfc done
Copying config 69593048aa done
Writing manifest to image destination
Storing signatures
(pulp) [vagrant@pulp3-source-fedora34 ~]$ http :24817/pulp/api/v3/distributions/container/container/
HTTP/1.1 200 OK
Access-Control-Expose-Headers: Correlation-ID
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 667
Content-Type: application/json
Correlation-ID: ad496a2ee1a64f4ca27b89710b3abb3b
Date: Wed, 21 Jul 2021 11:10:55 GMT
Server: gunicorn
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"base_path": "test/repo",
"content_guard": "/pulp/api/v3/contentguards/container/content_redirect/8d76caec-0744-4732-aa58-5f92bdaccce1/",
"description": null,
"name": "test/repo",
"namespace": "/pulp/api/v3/pulp_container/namespaces/6de42df7-5ea8-46a5-9256-45fe0233d059/",
"private": false,
"pulp_created": "2021-07-21T11:10:45.074548Z",
"pulp_href": "/pulp/api/v3/distributions/container/container/4d246845-af98-45aa-938f-67d434126b73/",
"pulp_labels": {},
"registry_path": "localhost:24817/test/repo",
"repository": "/pulp/api/v3/repositories/container/container-push/4cbc82ce-8230-486a-b18b-70f064f1594a/",
"repository_version": null
}
]
}
2. Create directory into which you plan to export the image
(pulp) [vagrant@pulp3-source-fedora34 ~]$ mkdir /tmp/air-gapped1/repo
3. Run skopeo copy command
$ skopeo copy docker://localhost:24817/test/repo:latest dir:/tmp/air-gapped1/repo --tls-verify=false
WARN[0000] '--tls-verify' is deprecated, please set this on the specific subcommand
Getting image source signatures
Copying blob a9efad4c351b done
Copying config 69593048aa done
Writing manifest to image destination
Storing signatures
(pulp) [vagrant@pulp3-source-fedora34 ~]$ ll /tmp/air-gapped1/repo/
total 780
-rw-r--r--. 1 vagrant vagrant 1457 Jul 21 11:49 69593048aa3acfee0f75f20b77acb549de2472063053f6730c4091b53f2dfb02
-rw-r--r--. 1 vagrant vagrant 784516 Jul 21 11:49 a9efad4c351baa14138b2ddca283c33974c1957b59981f77642ccf4398981045
-rw-r--r--. 1 vagrant vagrant 427 Jul 21 11:49 manifest.json
-rw-r--r--. 1 vagrant vagrant 33 Jul 21 11:49 version
4. Login with podman or skopeo into the air-gapped environment
(pulp) [vagrant@pulp3-source-fedora34 ~]$ skopeo login localhost:24817 --tls-verify=false
Username: admin
Password:
Login Succeeded!
5. Skopeo copy the image into the registry
(pulp) [vagrant@pulp3-source-fedora34 ~]$ skopeo copy dir:/tmp/air-gapped1/repo docker://localhost:24817/test/repo:latest --tls-verify=false
WARN[0000] '--tls-verify' is deprecated, please set this on the specific subcommand
Getting image source signatures
Copying blob a9efad4c351b done
Copying config 69593048aa done
Writing manifest to image destination
Storing signatures
(pulp) [vagrant@pulp3-source-fedora34 ~]$ http :24817/pulp/api/v3/distributions/container/container/
HTTP/1.1 200 OK
Access-Control-Expose-Headers: Correlation-ID
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 667
Content-Type: application/json
Correlation-ID: 624e9706e50442a68208b876ee7a76dc
Date: Wed, 21 Jul 2021 11:51:59 GMT
Server: gunicorn
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"base_path": "test/repo",
"content_guard": "/pulp/api/v3/contentguards/container/content_redirect/9f1ecfce-3faa-4105-bcac-fbc7ba12d324/",
"description": null,
"name": "test/repo",
"namespace": "/pulp/api/v3/pulp_container/namespaces/038ec552-3b77-45ce-9f2d-d065d80b98bc/",
"private": false,
"pulp_created": "2021-07-21T11:51:34.496859Z",
"pulp_href": "/pulp/api/v3/distributions/container/container/5ab34048-35d6-4aa9-9a71-cdb642461250/",
"pulp_labels": {},
"registry_path": "localhost:24817/test/repo",
"repository": "/pulp/api/v3/repositories/container/container-push/f7399894-a176-4d6d-9837-6b9970474cbf/",
"repository_version": null
}
]
}
(pulp) [vagrant@pulp3-source-fedora34 ~]$ podman pull localhost:24817/test/repo --tls-verify=false
Trying to pull localhost:24817/test/repo:latest...
Getting image source signatures
Copying blob a9efad4c351b [--------------------------------------] 0.0b / 0.0b
Copying config 69593048aa done
Writing manifest to image destination
Storing signatures
69593048aa3acfee0f75f20b77acb549de2472063053f6730c4091b53f2dfb02
(pulp) [vagrant@pulp3-source-fedora34 ~]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment