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

Can't set MAVEN_CONFIG with docker --env #77

Closed
neilhwatson opened this issue Apr 12, 2018 · 3 comments
Closed

Can't set MAVEN_CONFIG with docker --env #77

neilhwatson opened this issue Apr 12, 2018 · 3 comments

Comments

@neilhwatson
Copy link

docker run -it --rm --user 1000 --name rest-builder -e HOME=/tmp -e MAVEN_CONFIG=/tmp/.m2 maven:3-jdk-8-alpine env

Should show MAVEN_CONFIG set, but it doesn't:

LANG=C.UTF-8
HOSTNAME=75b2c4f4c9a8
MAVEN_HOME=/usr/share/maven
JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
JAVA_VERSION=8u151
PWD=/
HOME=/tmp
TERM=xterm
SHLVL=0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
JAVA_ALPINE_VERSION=8.151.12-r0
BASH_FUNC_copy_reference_file%%=() {  local root="${1}";
 local f="${2%/}";
 local logfile="${3}";
 local rel="${f/${root}/}";
 echo "$f" >> "$logfile";
 echo " $f -> $rel" >> "$logfile";
 if [[ ! -e ${MAVEN_CONFIG}/${rel} || $f = *.override ]]; then
 echo "copy $rel to ${MAVEN_CONFIG}" >> "$logfile";
 mkdir -p "${MAVEN_CONFIG}/$(dirname "${rel}")";
 cp -r "${f}" "${MAVEN_CONFIG}/${rel}";
 fi
}
@carlossg
Copy link
Owner

MAVEN_CONFIG is used internally only then unset

@neilhwatson
Copy link
Author

Sorry I don't understand your comment. On this page: https://hub.docker.com/_/maven/, section "Running as non-root" is shows an example of setting MAVEN_CONFIG.

@carlossg
Copy link
Owner

And that example works. The MAVEN_CONFIG env var is used and then is unset.
It is unset because other tools use the same name variable 0490eff

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

2 participants