GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.69k stars 1.44k forks source link

Registry may not support pushing OCI Manifest or Docker Image Manifest Version 2, Schema 2 #3268

Closed Schachte closed 3 years ago

Schachte commented 3 years ago

I'm getting the following error when pushing an image to Artifactory via Jib.

Format is not OCI. Why does it still appear?

Tried to push image manifest for mycoolimage:latest but failed because: Registry may not support pushing OCI Manifest or Docker Image Manifest Version 2, Schema 2 | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new

Code (Gradle)

jib {
    def inputTag = project.hasProperty('inputTag') ? project.property('inputTag') : 'latest'
    container {
        mainClass = 'helloworld'
        creationTime = 'USE_CURRENT_TIMESTAMP'
        format = 'Docker'
    }
    to {
        image = 'mycoolimage'
        tags = [inputTag, 'latest']
    }
}
chanseokoh commented 3 years ago

Note that it's saying "OCI or Docker." Definitely you are not pushing OCI.

@Schachte probably the root cause is irrelevant of the format but that your registry refuses to accept a valid manifest for some reason. There can be multiple different reasons, but here's one: #3215

What's the response you get from your registry? Providing --stacktrace will give you more details. (--debug) also works, but it may output too much detail.)

chanseokoh commented 3 years ago

Responded to the user through multiple channels (including the GItter gitter.im/google/jib), but no update so far. Closing due to inactivity. But to be clear, I don't believe there's a bug in Jib.

dsvensson commented 1 month ago

@chanseokoh fyi this happens when pushing an image to an immutable AWS ECR repository that already contains the tag. Not very intuitive error message. A bit annoying if pushing multiple images in CI and using commit hash as image tag, and one of them flakes while the others pass. Then a retry of the build will end up with that as those images will try to push again. Would be nice with a skip-if-exists option.

Aha, didn't know of jib.skipExistingImages