Skip to content

Dockerfile ARG default throws NPE if ARG is null #1528

Closed
@twendelmuth

Description

Description

It seems like if you're building a Dockerfile with ARG and defining a default like ARG TEST=test and pass <TEST></TEST> to the plugin, this will fail with NullpointerException in https://github.com/fabric8io/docker-maven-plugin/blob/master/src/main/java/io/fabric8/maven/docker/util/DockerFileUtil.java#L268

Info

  • docker-maven-plugin version : 0.39.0

  • pom.xml configuration

			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>0.39.0</version>

				<configuration>
					<images>
						<image>
							<name>example-image</name>
							<build>
								<contextDir>example</contextDir>
								<args>
									<TEST></TEST>
								</args>
							</build>
						</image>
					</images>
				</configuration>
			</plugin>

  • Example Dockerfile:
FROM alpine
ARG TEST=something

The example is obviously not what is happening in the end (with that you could just ask me to remove the arg if I'm not setting it, but rather the problem that I have another variable in there which potentially is not set)

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions