Maven needs the user home to download artifacts to, and if the user does not exist in the image an extra user.home Java property needs to be set.
For example, to run as user 1000 mounting the host' Maven repo
$ docker run -v ~/.m2:/var/maven/.m2 -ti --rm -u 1000 -e MAVEN_CONFIG=/var/maven/.m2 maven mvn -Duser.home=/var/maven archetype:generateSource : https://hub.docker.com/_/mavenhttps://stackoverflow.com/questions/52780802/run-maven-in-docker-container-via-current-user/52781822
Aucun commentaire:
Enregistrer un commentaire
to criticize, to improve