I am downloading a docker image using Skopeo tool on a linux machine - Works successfully
skopeo copy --src-creds uname:pwd docker://url/image:tag dir:/home/image
I am trying to change the tag of this image. Currently the image tag is "latest" which needs to be changed as "new"
Is there any way using skopeo tool we can re-tag this image then upload to registry with a new tag.
Please Note: Docker is not allowed to be installed on linux machine as it needs root user which is unauthorized for our project.
I am trying the below sequence of activities
- Download an image from repository with tag "latest"- working
- Change the tag of the image to "new" and upload back to repository - working
- Download the image with new tag "new" - Fails with error.
PFB the commands in sequential order
skopeo copy --src-creds name:pwd docker://url/alpine:latest dir:/home/alpine
skopeo copy --dest-creds uname:pwd dir:/home/alpine docker://url/alpine:new
skopeo copy --src-creds uname:pwd docker://url/alpine:new dir:./alpinenew
**FATA[0004] Error initializing source docker://url/alpine:new: Error reading manifest new in url/alpine: manifest unknown: manifest unknown**
How to fix this error.
You don't need to "retag" the image. You set the tag when you upload the image to a remote repository. For example, to upload the image as
myusername/myimagename:sometag, I could run:To illustrate this, I can download the
alpineimage like this:And then upload this into my own namespace with a different name and tag like this:
That seems to work just fine.
I can then download the new image to verify that it worked:
This works just fine using the same image name in both locations:
This adds a new tag to the image.