Hi all,
I recently upgraded docker desktop to version 4.31.1 and since then all the images I build have the manifest media type “application/vnd.oci.image.manifest.v1+json”. However, I need them to have the media type “application/vnd.docker.distribution.manifest.v2+json”.
How can I force the images I build to have the manifest media type “application/vnd.docker.distribution.manifest.v2+json”?
OS: Windows 11
Docker Version: 26.1.4 (client), 4.31.1 (server)
Client:
Version: 26.1.4
API version: 1.45
Go version: go1.21.11
Git commit: 5650f9b
Built: Wed Jun 5 11:29:54 2024
OS/Arch: windows/amd64
Context: desktop-linux
Server: Docker Desktop 4.31.1 (153621)
Engine:
Version: 26.1.4
API version: 1.45 (minimum version 1.24)
Go version: go1.21.11
Git commit: de5c9cf
Built: Wed Jun 5 11:29:22 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.33
GitCommit: d2d58213f83a351ca8f528a95fbd145f5654e957
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Steps to reproduce:
FROM python:3.11-slim
# Upgrade installed packages
RUN apt-get update && apt-get upgrade -y && apt-get clean
RUN apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
openjdk-17-jdk-headless \
&& \
rm -rf /var/lib/apt/lists/*
# Define an entrypoint script for the docker image
ENTRYPOINT ["python"]
# Define command to be passed to the entrypoint
CMD ["-c", "print('Hello, World!')"]
# use local docker registry
docker run -d -p 5000:5000 --name registry registry
docker build -t localhost:5000/example .
docker push localhost:5000/example
# inspect image to see manifest media type
docker buildx imagetools inspect localhost:5000/example
Manifests:
Name: localhost:5000/example:latest@sha256:
MediaType: application/vnd.oci.image.manifest.v1+json
Platform: linux/amd64