Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker APIv2 /commit ignores uploaded config #13770

Closed
matejvasek opened this issue Apr 4, 2022 · 13 comments · Fixed by #20657
Closed

Docker APIv2 /commit ignores uploaded config #13770

matejvasek opened this issue Apr 4, 2022 · 13 comments · Fixed by #20657
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@matejvasek
Copy link
Contributor

matejvasek commented Apr 4, 2022

As consequence the s2i utility is not working with podman when used as a docker daemon,
because resulting image has incorrect Cmd.

Related to openshift/source-to-image#1082

@matejvasek
Copy link
Contributor Author

/kind bug

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 4, 2022
@matejvasek
Copy link
Contributor Author

/cc @jwhonce

@matejvasek
Copy link
Contributor Author

The endpoint loads container state including config from DB. The config from request body is ignored.

@matejvasek matejvasek changed the title Docker APIv2 /commit endpoint is not updating Cmd of container Docker APIv2 /commit endpoint is not updating Cmd of image Apr 5, 2022
@vrothberg
Copy link
Member

Thanks for reaching out, @matejvasek. Do you have cycles to open a PR?

@matejvasek
Copy link
Contributor Author

@vrothberg I don't know how to fix this from top of my head.
I can think of hack solution: write ENTRYPOINT/CMD/ENV to the Changes option as Dockerfile commands, but I don't think that's good idea. Any hint how to approach this?

@matejvasek
Copy link
Contributor Author

The container structure is pretty much immutable so I cannot easily overwrite fields in the ctr config.

@vrothberg
Copy link
Member

Apologies, I do not have time to look into the issue at the moment.

@github-actions
Copy link

github-actions bot commented May 8, 2022

A friendly reminder that this issue had no activity for 30 days.

matejvasek added a commit to matejvasek/faas that referenced this issue May 11, 2022
Workaround a bug in podman:
containers/podman#13770

Signed-off-by: Matej Vasek <mvasek@redhat.com>
matejvasek added a commit to matejvasek/faas that referenced this issue May 11, 2022
Workaround a bug in podman:
containers/podman#13770

Signed-off-by: Matej Vasek <mvasek@redhat.com>
matejvasek added a commit to matejvasek/faas that referenced this issue May 11, 2022
Workaround a bug in podman:
containers/podman#13770

Signed-off-by: Matej Vasek <mvasek@redhat.com>
matejvasek added a commit to matejvasek/faas that referenced this issue May 11, 2022
Workaround a bug in podman:
containers/podman#13770

Signed-off-by: Matej Vasek <mvasek@redhat.com>
matejvasek added a commit to matejvasek/faas that referenced this issue May 12, 2022
Workaround a bug in podman:
containers/podman#13770

Signed-off-by: Matej Vasek <mvasek@redhat.com>
knative-prow bot pushed a commit to knative/func that referenced this issue May 12, 2022
Workaround a bug in podman:
containers/podman#13770

Signed-off-by: Matej Vasek <mvasek@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Jul 30, 2023

@matejvasek is this still an issue. It got lost because the stale-issue flag was set and no one noticed, so it was lost in the flood of issues.

@matejvasek
Copy link
Contributor Author

@rhatdan I don't know. I just decided not to use this this endpoint.

@vrothberg vrothberg self-assigned this Oct 19, 2023
@vrothberg
Copy link
Member

I'll take a look now.

@vrothberg vrothberg changed the title Docker APIv2 /commit endpoint is not updating Cmd of image Docker APIv2 /commit ignores uploaded config Oct 19, 2023
@vrothberg
Copy link
Member

Works with changes on my end:

podman (fix-13770) $ DOCKER_HOST=unix:///run/user/1000/podman/podman.sock docker commit --change CMD=xxx af
9f6254c2e22e02deaf5ca275c12598174972218b6abe2a6f006f0f92c5092061
podman (fix-13770) $ podman image inspect 9f|less
podman (fix-13770) $ podman image inspect 9f --format "{{.Config.Cmd}}"
[/bin/sh -c xxx]

What does not work though - as implied above - is that the compat endpoint entirely ignores the upload container config, see https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageCommit.

@vrothberg
Copy link
Member

OK, I do not have enough time to tackle it but I can propose a solution. We can extend libpod's Commit() API to account for the config of the compat endpoint and use the imported builder (see https://github.com/containers/podman/blob/main/libpod/container_commit.go#L70-L80) to set the specific fields of the docker config.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Mar 1, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants