This repository was archived by the owner on Mar 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 563
This repository was archived by the owner on Mar 21, 2022. It is now read-only.
Replace empty envs with "" and not "null" #212
Copy link
Copy link
Open
Labels
Description
Description
Replace empty envs with "" and not "null".
This causes unnecessary application-errors (see command below).
How to reproduce
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.3</version>
<configuration>
<serverId>dockerhub-jeggers</serverId>
<imageName>jeggers/${project.artifactId}</imageName>
<forceTags>true</forceTags>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<baseImage>jeanblanchard/java:serverjre-8</baseImage>
<volumes>
<volume>/var/log/apps</volume>
</volumes>
<env>
<REGISTRY_USERNAME></REGISTRY_USERNAME>
<REGISTRY_EMAIL></REGISTRY_EMAIL>
<REGISTRY_PASSWORD></REGISTRY_PASSWORD>
<HOST_URI></HOST_URI>
<HOST_CERTIFICATES></HOST_CERTIFICATES>
<HTTP_PORT>7777</HTTP_PORT>
<JAVA_OPTS>-Dfoo=bar</JAVA_OPTS>
</env>
<cmd>["/bin/sh", "-c", "java -Ddocker.registry.username=${REGISTRY_USERNAME} -Ddocker.registry.email=${REGISTRY_EMAIL} -Ddocker.registry.password=${REGISTRY_PASSWORD} -Ddocker.host.uri=${HOST_URI} -Ddocker.host.certificates.directory=${HOST_CERTIFICATES} -Dserver.port=${HTTP_PORT} -Dfile.encoding=UTF-8 ${JAVA_OPTS} -jar /${project.build.finalName}.${project.packaging}"]</cmd>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.${project.packaging}</include>
</resource>
</resources>
</configuration>
</plugin>
What do you expect
Replace empty envs with "" and not "null".
What happened instead
The following command is executed, when the empty envs are not overwritten:
java -Ddocker.registry.username=null -Ddocker.registry.email=null -Ddocker.registry.password=null -Ddocker.host.uri=null -Ddocker.host.certificates.directory=null -Dfile.encoding=UTF-8 null /docker-autodeploy.jar
Software:
- docker version: 1.10.3
- docker-maven-plugin version: 0.4.3
- maven version: 3.0.5
Reactions are currently unavailable