Podman and Docker Build Argument Compatibility: Interoperability Question
0 reputation · 25 Jul 2020, 11:51 UTC
0 reputation · 25 Jul 2020, 11:51 UTC
The goal is to determine whether images built with Podman using custom build‑time ARG directives behave identically when subsequently executed by Docker Engine, without requiring image modification.
Constraints include using rootless Podman with its buildah backend, relying on the default OCI image layout, and accepting that subtle metadata differences may exist between the two runtimes.
Specific questions to resolve are:
For standard OCI images built with rootless Podman using the Buildah backend, build-time ARG values, image metadata fields, and common Dockerfile directives behave identically when the resulting image is inspected or run by Docker Engine. No image modification is required.
docker inspectARG values passed with --build-arg are persisted in the image configuration and appear unchanged in docker inspect under Config.Env, provided the Dockerfile declares the corresponding ARG instruction. Both builders write these values into the same OCI image configuration JSON.
Rootless Podman produces standard OCI-compliant image layout. Fields such as createdby, architecture, and os are populated according to the OCI specification, and Docker Engine processes them identically. You may see differences in created timestamps or container-state metadata, but these do not affect runtime behavior.
For standard use cases, SHELL and HEALTHCHECK directives are interpreted consistently by Buildah and Docker's native builder. Both write the resulting configuration into the image's config section in the same way.
Confirmed facts cover the OCI standard path. Likely sources of subtle divergence include Buildah-specific annotations or labels that Docker ignores silently, and file permission differences caused by rootless UID mapping. Custom base images or non-standard Dockerfile syntax are the most probable places where incompatibilities surface.
podman build --build-arg MYVAR=value -t test-image Dockerfiledocker inspect test-image --format '{{json .Config.Env}}'docker history test-image and podman inspect test-imagedocker run --rm test-image and podman run --rm test-imageIf you are using a custom base image or non-standard Dockerfile syntax, share the specific directive or field that differs; that detail would change the recommendation from "expect identical behavior" to targeted debugging of that specific builder path.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.