[19.4] Build Docker images with Docker media types for Podman
What does this MR do and why?
Backport of !9982 (merged)
to 19-4-stable.
Recent BuildKit versions default to publishing images with OCI media types
instead of Docker (v2 schema 2) manifests. The HEALTHCHECK instruction lives
in the Docker image config and is dropped from the OCI config, so Podman can no
longer read it: podman ps stops showing health status, and
podman healthcheck run and compose service_healthy conditions fail.
The build uses the docker buildx docker-container driver, which pulls its
BuildKit image separately from the engine, defaulting to the floating
moby/buildkit:buildx-stable-1 tag. This MR forces Docker media types on push
with --output=type=image,oci-mediatypes=false, disables provenance
attestations (which force an OCI image index and are incompatible with
oci-mediatypes=false), and pins the BuildKit image via a new BUILDKIT_IMAGE
variable so an upstream default change cannot silently alter the published
manifests.
Related work item: #10165
The cherry-pick was clean apart from gitlab-ci-config/variables.yml, where the
stable branch is maintained in a normalized (comment-free) form; the new
BUILDKIT_IMAGE line was added right after DOCKER_DIND_IMAGE to match that
style. The lib/gitlab/docker_helper.rb and spec changes are identical to the
original MR.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
- The original MR has been deployed to GitLab.com (not applicable for documentation or spec changes).
- This MR has a severity label assigned (if applicable).
Note to the merge request author and maintainer
If you have questions about the patch release process, please:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only).