Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Replace empty envs with "" and not "null" #212

Open
julian-eggers opened this issue Mar 29, 2016 · 1 comment
Open

Replace empty envs with "" and not "null" #212

julian-eggers opened this issue Mar 29, 2016 · 1 comment
Labels
bug help wanted pinned exempted from stalebot

Comments

@julian-eggers
Copy link

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
@stale
Copy link

stale bot commented Sep 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 11, 2018
@davidxia davidxia added the pinned exempted from stalebot label Sep 11, 2018
@stale stale bot removed the stale label Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug help wanted pinned exempted from stalebot
Projects
None yet
Development

No branches or pull requests

2 participants