carlossg / docker-maven

Official Docker image with Maven
Apache License 2.0
525 stars 424 forks source link

amazoncorretto-11-debian ignores environment variables with a period #404

Closed dr29bart closed 1 year ago

dr29bart commented 1 year ago

debian based maven image ignores env vars with periods:

docker run -e "foo=bar" -e "CL.pass=zzz" maven:3.9-amazoncorretto-11-debian mvn help:system | grep "Environment Variables" -A 55

Environment Variables
===============================================================================

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAVEN_HOME=/usr/share/maven
HOSTNAME=e75c70f1eb22
foo=bar
MAVEN_PROJECTBASEDIR=/
OLDPWD=/
PWD=/
MAVEN_CMD_LINE_ARGS= help:system
HOME=/root

The output does not have CL.pass variable

Expected result: The same commend in 3.9-amazoncorretto-11

docker run -e "foo=bar" -e "CL.pass=zzz" maven:3.9-amazoncorretto-11 mvn help:system | grep "Environment Variables" -A 55
Environment Variables
===============================================================================

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
foo=bar
JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto
MAVEN_PROJECTBASEDIR=/
OLDPWD=/
LANG=C.UTF-8
MAVEN_HOME=/usr/share/maven
HOSTNAME=df80a327972d
CL.pass=zzz
PWD=/
SHLVL=0
HOME=/root
MAVEN_CMD_LINE_ARGS= help:system
carlossg commented 1 year ago

environment variables with dots are not valid in shells like bash and not

https://stackoverflow.com/questions/58482343/dots-in-env-variable-in-dockerfile-doesnt-work