Skip to content

ParsedDockerfile's parsing of FROM lines doesn't handle arguments #2772

@rdicroce

Description

@rdicroce

Given a Dockerfile with a line like:

FROM --platform=linux/amd64 openjdk:8u252-jre

you will get warnings in the log that look like:

09:06:07.355 [tc-okhttp-stream-748761773] ERROR com.github.dockerjava.api.async.ResultCallbackTemplate - Error during callback
com.github.dockerjava.api.exception.BadRequestException: {"message":"invalid reference format"}

	at com.github.dockerjava.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:283)
	at com.github.dockerjava.okhttp.OkHttpInvocationBuilder.lambda$executeAndStream$4(OkHttpInvocationBuilder.java:317)
	at java.lang.Thread.run(Thread.java:748)
09:06:07.355 [main] WARN org.testcontainers.images.builder.ImageFromDockerfile - Unable to pre-fetch an image (--platform=linux/amd64) depended upon by Dockerfile - image build will continue but may fail. Exception message was: {"message":"invalid reference format"}

because ParsedDockerfile's regex doesn't handle parameters.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions