google / google/go-containerregistry

crane: Rebase give inconsistent layer types if the original image and new base use different layer types

Open
#2,101 1 comment 0 reactions 0 assignees View on GitHub
bug lifecycle/stale
Dominant language
Go
Stars
4k
Forks
686
Avg merge
2d 12h
Merged PRs (30d)
26

Description

### Describe the bug

The image resulting from a rebase in which the original image and new base don't have the same layer types is not usable.

### To Reproduce

1. Create an image using `application/vnd.docker.image.rootfs.diff.tar.gzip` layer type. For example, an image produced by Jib.
2. Rebase it on a base using `application/vnd.oci.image.layer.v1.tar+gzip` layer type. (It could be the same base as the Jib image.)
3. The resulting image has OCI layer types on top of Docker layer types and is unusable.

_Edit: the image is unusable with `podman run`, but seems to work when using `docker run`._

### Expected behavior

The rebase should normalize the layer types so that the resulting image is usable.

Contributor guide

Open the contributing guide

Research direction

Start at the crane rebase entry point and inspect how layer media types are retained when combining the original image with the new base. Reproduce the case with Docker and OCI layer types, then verify that the rebased image uses normalized layer types and runs with podman.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.