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

AWS ECR Manifest MediaType #2883

Open
guimorg opened this issue Nov 30, 2023 · 1 comment
Open

AWS ECR Manifest MediaType #2883

guimorg opened this issue Nov 30, 2023 · 1 comment
Labels
feat/oci issue/mediaType kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next.

Comments

@guimorg
Copy link

guimorg commented Nov 30, 2023

Actual behavior

We use gcr.io/kaniko-project/executor:debug to build images for a long time, usually, our base images are python slim images, which when inspected have their manifest mediaType as "mediaType": "application/vnd.oci.image.manifest.v1+json",.

We proceed to push the images built by kaniko to ECR and they remain annotated with "mediaType": "application/vnd.docker.distribution.manifest.v2+json".

Nevertheless, today we've noticed via some inconsistencies with unsupported mediaType that these same images when built had their mediaType pushed as OCI to our AWS ECR repository.

I am unsure if this is expected or not since we've had processes for a long time working like this where the manifest was pushed as Docker V2 and not OCI. I've made a simple test locally (with Docker, though) and the image is pushed as Docker V2, but when running kaniko on GitLab CI the images were pushed as OCI.

Expected behavior
A clear and concise description of what you expected to happen.

I've expected the same behavior from previous executions where images were pushed as Docker V2 manifest mediaType.

To Reproduce
Steps to reproduce the behavior:

  1. Build kaniko image with command:
     /kaniko/executor
      --build-arg CI_REGISTRY="$CI_REGISTRY"
      --context $BUILD_CONTEXT
      --dockerfile $BUILD_DOCKERFILE_PATH
      --destination $CONTAINER_IMAGE_NAME:$CONTAINER_IMAGE_TAG
  1. Check the docker manifest pushed to ECR:
docker manifest inspect <account>.dkr.ecr.<region>.amazonaws.com/<CONTAINER_IMAGE_NAME>:<CONTAINER_IMAGE_TAG>

Additional Information

  • Dockerfile
    Please provide either the Dockerfile you're trying to build or one that can reproduce this error.
# Basic Slim Python Image
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE

ADD requirements.txt .

RUN python3 -m pip install -r requirements.txt && \
    rm -rf /root/.cache

COPY ./ /opt/

ENV PATH="/opt/:${PATH}"

RUN chmod +x /opt/*

EXPOSE 8080
  • Build Context
    Please provide or clearly describe any files needed to build the Dockerfile (ADD/COPY commands)
app.py   Dockerfile   requirements.txt
  • Kaniko Image (fully qualified with digest)
    (internal image on ECR)

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added issue/mediaType priority/p1 Basic need feature compatibility with docker build. we should be working on this next. feat/oci kind/bug Something isn't working labels Dec 4, 2023
@tanadeau
Copy link

tanadeau commented Feb 7, 2024

Are there any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/oci issue/mediaType kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next.
Projects
None yet
Development

No branches or pull requests

3 participants