https://github.com/alpine-docker/crane
crane is a tool for interacting with remote images and registries.
https://github.com/alpine-docker/crane
Last synced: about 1 month ago
JSON representation
crane is a tool for interacting with remote images and registries.
- Host: GitHub
- URL: https://github.com/alpine-docker/crane
- Owner: alpine-docker
- License: mit
- Created: 2023-11-19T11:17:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T12:17:49.000Z (over 1 year ago)
- Last Synced: 2025-01-25T15:27:49.634Z (over 1 year ago)
- Language: Shell
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crane
https://github.com/google/go-containerregistry/tree/main/cmd/crane
Follow up blog: [Copying and Tagging Multi-Architecture Images](https://medium.com/@ozbillwang/multi-arch-image-copy-and-tag-a7d95c43e3b7)
### usage #1
```
$ docker run --rm alpine/crane ls ubuntu
10.04
12.04.5
12.04
12.10
```
### usage #2
copy the image, for example, nginx, with its multi-arch as well
```
docker run -ti --rm -v $(pwd)/.docker:/root/.docker alpine/crane auth login -u -p index.docker.io
docker run -ti --rm -v $(pwd)/.docker:/root/.docker alpine/crane copy nginx /nginx
# for example
docker run -ti --rm -v $(pwd)/.docker:/root/.docker alpine/crane auth login -u ozbillwang -p dckr_pat_vynZPg8C5KsqItk-xxxxxxxxxx index.docker.io
# check the auth config file
more .docker/config.json
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "b3piaWxsd2FuZzpkYxxxx"
}
}
}
docker run -ti --rm -v $(pwd)/.docker:/root/.docker alpine/crane copy nginx ozbillwang/nginx
```
After done, you should see the image in your account and the image has its all OS and Arch, all DIGEST are same

### usage #3
create a tag for image, with its multi-arch as well
```
docker run -ti --rm -v $(pwd)/.docker:/root/.docker alpine/crane tag ozbillwang/nginx abc
```
