Skip to content
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

'Environment variable must not be null or empty if building an image' #434

Closed
rodlogic opened this issue Apr 28, 2016 · 3 comments
Closed

Comments

@rodlogic
Copy link

This seems to be a bit harsh :-) What if I want to send an empty environment var either to unset a default or to just document that that env can be changed in the pom.

Here is the error I got trying to declare an empty var:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.14.2:build (build) on project docker-app: Execution build of goal io.fabric8:docker-maven-plugin:0.14.2:build failed: Environment variable 'DATASOURCE_PASSWORD' must not be null or empty if building an image -> [Help 1]
@rhuss
Copy link
Collaborator

rhuss commented Apr 29, 2016

see the point. Just checked that Docker supports empty value, which seems to be the case (I darkly remembered that Docker croaked on empty env values in the Dockerfile sometimes ago).

However you want be able to unset the variable that way. I will always be set, even when the value is empty.

will fix that for the next version, thanks ...

rhuss added a commit that referenced this issue Apr 29, 2016
as it seems Docker allows this, too. Fixes #434
@rodlogic
Copy link
Author

Grazie

@fabienmifsud
Copy link

fabienmifsud commented May 5, 2020

I still have the issue with v.0.33.0 with this build conf :

<build>
   <from>library/openjdk:8-jre-alpine</from>
   <env>
      <JAVA_OPTS> </JAVA_OPTS>
   </env>
   <entryPoint>
      <exec>
         <args>java</args>
         <args>$JAVA_OPTS</args>
         <args>-jar</args>
         <args>/maven/${project.artifactId}-${project.version}.jar</args>
      </exec>
   </entryPoint>
   <assembly>
      <descriptorRef>artifact</descriptorRef>
   </assembly>
   <ports>
      <port>8080</port>
   </ports>
</build>

Thank you for advices !

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

No branches or pull requests

3 participants