-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Build image pull
field type mismatch with Docker
#17778
Comments
A friendly reminder that this issue had no activity for 30 days. |
Do you have an example with curl to show us failing, where docker succeeds? |
Reproduced on Fedora CoreOS (fedora-coreos-38.20230430.1.0-qemu.aarch64)
Output from step 9
There was no output from step 10 Output from step 11
About the system:
|
`pull` parameter in `build` must accept string just like docker. Ref: https://docs.docker.com/engine/api/v1.42/#tag/Image/operation/ImageBuild Closes: containers#17778 Signed-off-by: Aditya R <[email protected]>
@eriksjolund @cristianrgreco @flouthoc This is really strange. The docker client sets this value to "1" (for true), and server handles it like a boolean too. server: This means the The PR #18583 actually breaks compatibility instead of fixing it.
I would suggest to revert it back to boolean. The older code is not 100% compliant but much better that what we have now. Then it could be improved upon by register custom boolean deserializer for compat endpoints. dec.RegisterConverter(true, func(s string) reflect.Value {
s = strings.ToLower(strings.TrimSpace(s))
return reflect.ValueOf(!(s == "" || s == "0" || s == "no" || s == "false" || s == "none"))
}) You may argue that doc says it's a string but I trust actual code much more. |
IMO the Docker API documentation should be fixed. |
Looking at the source code of Docker it seems there is not such thing as pull policy. It simply interprets |
This reverts commit 5b148a0. Reverting to treating the `pull` query parameter as a boolean. Because of deceiving Docker API documentation it was assumed that the parameter is pull-policy, however that is not true. Docker does treat `pull` as a boolean. What is interesting is that Docker indeed accepts strings like `always` or `never` however Docekr both of these strings treat as `true`, not as pull-policy. As matter of the fact it seems there is no such a thing as pull-policy in Docker. More context containers#17778 (comment) Signed-off-by: Matej Vasek <[email protected]>
Issue Description
Docker accepts any string value for the
pull
field to indicate the image should be pulled:https://docs.docker.com/engine/api/v1.42/#tag/Image/operation/ImageBuildPodman expects the value to equal either boolean
true
or stringtrue
:https://docs.podman.io/en/latest/_static/api.html?version=v4.4#tag/images/operation/ImageBuildLibpod
Applications that align with Docker's spec are unable to switch to Podman as building an image with this field fails.
Steps to reproduce the issue
pull
set to a string, such asalways
.Describe the results you received
No response stream received
Describe the results you expected
Expected a response stream
podman info output
Podman in a container
Yes
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
Additional information
No response
The text was updated successfully, but these errors were encountered: