Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport tagging an image while loading image with docker load -i #40188
Comments
save and load image with tags correctly |
|
you can try "docker save demo/demo:1.0 -o demo.tgz" .then "docker load -i demo.tgz" |
|
I think this works if the tag was used at the time of saving, I can get the tag back. I am talking about the case whereby the tag was not used to save the image, but SHA was. In this case it will be great to have a way to tag the image while loading. That is what this feature request is about. |
|
#dibs |
|
@sandipchitale Can you please re-assign this task to me ? |
|
Hi @sandipchitale @AkihiroSuda. For clarity. Do you want a workflow like this?
docker build -t myapp:v1 .
REPOSITORY TAG IMAGE ID CREATED SIZE
myapp v1 76cfa8011d00 About a minute ago 803MB
docker save 76cfa8011d00 -o myapp.v1.tgz
docker load -i myapp.v1.tgzCurrent behavior after executed commands: REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 76cfa8011d00 2 minutes ago 803MBExpected behavior after commands executed: REPOSITORY TAG IMAGE ID CREATED SIZE
myapp v1 76cfa8011d00 2 minutes ago 803MB |
|
The name:tag should be specified explicitly like |
|
I think if we will use -t flag with *.tgz file which contains two or more images (because save command can save more then one image to archive) we will get an error because we can't set one tag for different images. |
|
Maybe we should give up supporting this proposal then, and instead we should support |
I think it's a good idea. But we can add |
|
@AkihiroSuda I found a better way. In the current workflow we have an image: REPOSITORY TAG IMAGE ID CREATED SIZE
customtag v1 bf756fb1ae65 4 months ago 13.3kBIf we docker save customtag:v1 -o customtag.v1.tgzAnd after we load this image from REPOSITORY TAG IMAGE ID CREATED SIZE
customtag v1 bf756fb1ae65 4 months ago 13.3kBI think need to save tags also when we save image via id( docker image list --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" | external-script |
|
Multiple tags can refer to an ID though, so I'm not sure we should include all tags that reference that ID |
|
Hmmm. I think we should include all the tags for one ID. docker save IMAGE_ID -o app.tgzAnd when I load image from REPOSITORY TAG IMAGE ID CREATED SIZE
custom v1 bf756fb1ae65 4 months ago 13.3kB
hello-world latest bf756fb1ae65 4 months ago 13.3kB |
Description
Depending on how docker image tar was saved it does not have tags recorded in it. So I use
I get an image with out a tag.
Steps to reproduce the issue:
command to load a image tar which does not have tag
2. run
and see that the docker image does not have a tag.
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version: