Skip to content

ImagePlatform can cause "OS must not be empty" IllegalArgumentException #45152

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

Closed
philwebb opened this issue Apr 10, 2025 · 0 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@philwebb
Copy link
Member

Caused by: java.lang.IllegalArgumentException: OS must not be empty
	at org.springframework.util.Assert.hasText(Assert.java:253)
	at org.springframework.boot.buildpack.platform.docker.type.ImagePlatform.<init>(ImagePlatform.java:38)
	at org.springframework.boot.buildpack.platform.docker.type.ImagePlatform.from(ImagePlatform.java:99)
	at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.checkPlatformMismatch(Builder.java:265)
	at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.fetchImage(Builder.java:239)
	at org.springframework.boot.buildpack.platform.build.Builder.build(Builder.java:107)
	at org.springframework.boot.gradle.tasks.bundling.BootBuildImage.buildImage(BootBuildImage.java:364)
	at jdk.internal.reflect.GeneratedMethodAccessor1256.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Looks like something may have changed with Docker since I get:

$ docker inspect ghcr.io/spring-io/spring-boot-cnb-test-builder:0.0.1
[
    {
        "Id": "sha256:21635a6b4880772f3fabbf8b660907fa38636558cf787cc26f1779fc4b4e2cba",
        "RepoTags": [
            "ghcr.io/spring-io/spring-boot-cnb-test-builder:0.0.1"
        ],
        "RepoDigests": [
            "ghcr.io/spring-io/spring-boot-cnb-test-builder@sha256:21635a6b4880772f3fabbf8b660907fa38636558cf787cc26f1779fc4b4e2cba"
        ],
        "Parent": "",
        "Comment": "",
        "DockerVersion": "",
        "Author": "",
        "Config": null,
        "Architecture": "",
        "Os": "",
        "Size": 166797518,
        "GraphDriver": {
            "Data": null,
            "Name": "overlayfs"
        },
        "RootFS": {},
        "Metadata": {
            "LastTagTime": "2025-04-10T22:41:27.520294922Z"
        },
        "Descriptor": {
            "mediaType": "application/vnd.oci.image.index.v1+json",
            "digest": "sha256:21635a6b4880772f3fabbf8b660907fa38636558cf787cc26f1779fc4b4e2cba",
            "size": 513
        }
    }
]

Note that Os is now an empty string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant