It should create container name busybox2-working-container rather than the name busybox-working-container-4.
[root@fedora buildah]# buildah from busybox2
busybox-working-container-4
Hi @gouyang
I tried to reproduce it but unsuccessfully.
Here are my steps:
$ sudo ./buildah from --name bla docker://busybox
bla
$ sudo ./buildah containers
CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME
cf1f5f6da075 * 6ad733544a63 docker.io/library/busybox:latest bla
$ sudo ./buildah commit bla busybox2
$ sudo ./buildah images
IMAGE ID IMAGE NAME CREATED AT SIZE
6ad733544a63 docker.io/library/busybox:latest Nov 3, 2017 22:39 1.278 MB
c8451f3f397e docker.io/library/busybox2:latest Jan 17, 2018 06:58 1.278 MB
$ sudo ./buildah from docker://busybox2
busybox2-working-container
Can you describe your steps, please?
Thanks.
It works for the committed images, which I don't cover in the test, I will add a test for it.
It fails for the tagged images, steps like below. The problem happens recently as it works before, it works on buildah-0.9.
[root@fedora buildah]# ./buildah from busybox
busybox-working-container
[root@fedora buildah]# ./buildah tag busybox busybox2
[root@fedora buildah]# ./buildah from busybox2
busybox-working-container-2
[root@fedora buildah]# ./buildah commit busybox-working-container busybox3
[root@fedora buildah]# ./buildah from busybox3
busybox3-working-container
@gouyang tyvm for the reproducer!
It looks like when running buildah commit the image gets a new image ID while tag keeps the same image ID. When buildah from is being executed it generates the name from FromImage in the Builder structure.
If the image is a tag then FromImage will contain the original image. Otherwise, it will be the name given in buildah commit.
I think I can work on this, if you don't mind.
GO for it.
There is still an problem I met:
# buildah tag busybox busybox1
# buildah from busybox1
busybox1-working-container-4
# buildah from docker.io/busybox1
busybox-working-container-4
# buildah from docker.io/library/busybox1
busybox1-working-container-5
@gouyang thanks for the update and interesting development. @ripcurld0 can you take a peak?
@gouyang when I do docker.io/busybox1 I get
no such image "docker.io/busybox1": image not known
The same thing with docker.io/library/busybox1.
Which means I can't reproduce this problem. Can you show the entire flow?
Thanks.
EDIT:
Nevermind - figured it out!
@gouyang would you mind test this issue again.
Commit id: https://github.com/projectatomic/buildah/commit/815cedfc71fff7460b683b5f9e8fe053b31a31ef
PR: https://github.com/projectatomic/buildah/pull/422
Let me know if you find anything new. Till then, I am closing this issue.
Thanks.
Most helpful comment
GO for it.