Skip to content

Make the commit id clear like Docker#2124

Merged
bors[bot] merged 1 commit intocontainers:masterfrom
TomSweeneyRedHat:dev/tsweeney/doubleid
Feb 13, 2020
Merged

Make the commit id clear like Docker#2124
bors[bot] merged 1 commit intocontainers:masterfrom
TomSweeneyRedHat:dev/tsweeney/doubleid

Conversation

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

Using this Dockerfile:

FROM alpine AS tommer

Docker does:

Sending build context to Docker daemon  17.92kB
Step 1/1 : FROM alpine AS tommer
latest: Pulling from library/alpine
c9b1b535fdd9: Pull complete
Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Status: Downloaded newer image for alpine:latest
 ---> e7d92cdc71fe
Successfully built e7d92cdc71fe

While Buildah does:

STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a

Per user requests, we've over time eliminated some of the "noisier" output that
Docker has, and that's now led to some confusion when we show an intermediate
image id (after the commit) and then as in the case, the same final
image id immediately afterwards. We display only the full final image id to
make scripting easier per other user requests.

To aid with this, this pr will cause the intermediate image to be displayed
after an --> like Docker and will also show the 12 character short id.

If the --quiet option is used, this shorter id will not be displayed, only
the final longer one.

New behavior:

STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
--> e7d92cdc71f
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a

Fixes: containers/podman#5012

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

@vrothberg fyi and/or PTAL

return "", nil, err
}

logrus.Debugf("printing final image id %q", imageID)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this debug in my own self interest. This is the 3rd time in the past few months that I've spent 10 or more minutes looking for where the final image id is printed in the code. Hopefully going forward I'll remember to run the bud command in debug and will be able to locate it more quickly.

logImageID := func(imgID string) {
if s.executor.iidfile == "" {
fmt.Fprintf(s.executor.out, "%s\n", imgID)
fmt.Fprintf(s.executor.out, "--> %s\n", imgID[0:11])
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooops, forgot a length check, will add .

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Feb 2, 2020

Are there any man page examples that need to be updated?

Copy link
Copy Markdown
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than Dan's man page question, LGTM 👍 Thanks for the ping!

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

TomSweeneyRedHat commented Feb 6, 2020

We don't list the output of the build commands in the man page that I can see. In the tutorials we list some of it, but remove most of the output with a "{output removed for brevity}" kind of tag. So I don't think there are any changes to be made as far as that's concerned.

@vrothberg
Copy link
Copy Markdown
Member

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

📌 Commit f277e48 has been approved by vrothberg

@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit f277e48 with merge b477cba...

rh-atomic-bot pushed a commit that referenced this pull request Feb 6, 2020
Using this Dockerfile:
```
FROM alpine AS tommer
```
Docker does:
```
Sending build context to Docker daemon  17.92kB
Step 1/1 : FROM alpine AS tommer
latest: Pulling from library/alpine
c9b1b535fdd9: Pull complete
Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Status: Downloaded newer image for alpine:latest
 ---> e7d92cdc71fe
Successfully built e7d92cdc71fe
```

While Buildah does:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Per user requests, we've over time eliminateed some of the "noisier" output that
Docker has, and that's now led to some confusion when we show an intermediate
image id (after the commit) and then as in the case, the same final
image id immediately afterwards.  We display only the full final image id to
make scripting easier per other user requests.

To aid with this, this pr will cause the intermediate image to be displayed
after an `-->` like Docker and will also show the 12 character short id.

If the `--quiet` option is used, this shorter id will not be displayed, only
the final longer one.

New behavior:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
--> e7d92cdc71f
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Fixes: containers/podman#5012

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #2124
Approved by: vrothberg
@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@vrothberg
Copy link
Copy Markdown
Member

@rh-atomic-bot retry

@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit f277e48 with merge 5e5d19e...

rh-atomic-bot pushed a commit that referenced this pull request Feb 6, 2020
Using this Dockerfile:
```
FROM alpine AS tommer
```
Docker does:
```
Sending build context to Docker daemon  17.92kB
Step 1/1 : FROM alpine AS tommer
latest: Pulling from library/alpine
c9b1b535fdd9: Pull complete
Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Status: Downloaded newer image for alpine:latest
 ---> e7d92cdc71fe
Successfully built e7d92cdc71fe
```

While Buildah does:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Per user requests, we've over time eliminateed some of the "noisier" output that
Docker has, and that's now led to some confusion when we show an intermediate
image id (after the commit) and then as in the case, the same final
image id immediately afterwards.  We display only the full final image id to
make scripting easier per other user requests.

To aid with this, this pr will cause the intermediate image to be displayed
after an `-->` like Docker and will also show the 12 character short id.

If the `--quiet` option is used, this shorter id will not be displayed, only
the final longer one.

New behavior:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
--> e7d92cdc71f
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Fixes: containers/podman#5012

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #2124
Approved by: vrothberg
@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

💔 Test failed - status-papr

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

I think I'll have a merge conflict with #2149. Once that's in I'll rebase and work on this one again.

Using this Dockerfile:
```
FROM alpine AS tommer
```
Docker does:
```
Sending build context to Docker daemon  17.92kB
Step 1/1 : FROM alpine AS tommer
latest: Pulling from library/alpine
c9b1b535fdd9: Pull complete
Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Status: Downloaded newer image for alpine:latest
 ---> e7d92cdc71fe
Successfully built e7d92cdc71fe
```

While Buildah does:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Per user requests, we've over time eliminateed some of the "noisier" output that
Docker has, and that's now led to some confusion when we show an intermediate
image id (after the commit) and then as in the case, the same final
image id immediately afterwards.  We display only the full final image id to
make scripting easier per other user requests.

To aid with this, this pr will cause the intermediate image to be displayed
after an `-->` like Docker and will also show the 12 character short id.

If the `--quiet` option is used, this shorter id will not be displayed, only
the final longer one.

New behavior:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
--> e7d92cdc71f
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Fixes: containers/podman#5012

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Feb 12, 2020

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Feb 12, 2020

👎 Rejected by too few approved reviews

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Feb 13, 2020

bors retry

bors bot added a commit that referenced this pull request Feb 13, 2020
2124: Make the commit id clear like Docker r=rhatdan a=TomSweeneyRedHat

Using this Dockerfile:
```
FROM alpine AS tommer
```
Docker does:
```
Sending build context to Docker daemon  17.92kB
Step 1/1 : FROM alpine AS tommer
latest: Pulling from library/alpine
c9b1b535fdd9: Pull complete
Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Status: Downloaded newer image for alpine:latest
 ---> e7d92cdc71fe
Successfully built e7d92cdc71fe
```

While Buildah does:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Per user requests, we've over time eliminated some of the "noisier" output that
Docker has, and that's now led to some confusion when we show an intermediate
image id (after the commit) and then as in the case, the same final
image id immediately afterwards.  We display only the full final image id to
make scripting easier per other user requests.

To aid with this, this pr will cause the intermediate image to be displayed
after an `-->` like Docker and will also show the 12 character short id.

If the `--quiet` option is used, this shorter id will not be displayed, only
the final longer one.

New behavior:
```
STEP 1: FROM alpine AS tommer
STEP 2: COMMIT tom
--> e7d92cdc71f
e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
```
Fixes: containers/podman#5012

Co-authored-by: TomSweeneyRedHat <tsweeney@redhat.com>
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Feb 13, 2020

Build succeeded

  • cirrus-ci/success

@bors bors bot merged commit bb03eb3 into containers:master Feb 13, 2020
@TomSweeneyRedHat TomSweeneyRedHat deleted the dev/tsweeney/doubleid branch April 4, 2020 17:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman build prints image ID twice

4 participants