Given the behaviour observed below, I'm assuming leningen is obtaining the user's home from getent or similar path instead of relying (or even considering) ${HOME}.
Using a docker container with an arbitrary runtime user, the following behaviour is observed:
When the user exists in the container (i.e. nobody):
executing lein install will (try to) download dependencies to:
<user's home>/.m2
Expected failure due to perms in /:
bash-5.0$ id
uid=65534(nobody) gid=65534(nobody)
bash-5.0$ getent passwd $(id -u)
nobody:x:65534:65534:nobody:/:/sbin/nologin
bash-5.0$ echo ${HOME}
/build
bash-5.0$ pwd
/build/source/test
bash-5.0$
bash-5.0$ lein install
Could not transfer artifact lein-midje:lein-midje:jar:3.2 from/to central (https://repo1.maven.org/maven2/): /.m2/repository/lein-midje/lein-midje/3.2/lein-midje-3.2.jar.part.lock (No such file or directory)
Could not transfer artifact lein-midje:lein-midje:jar:3.2 from/to clojars (https://repo.clojars.org/): /.m2/repository/lein-midje/lein-midje/3.2/lein-midje-3.2.jar.part.lock (No such file or directory)
Could not transfer artifact lein-midje:lein-midje:pom:3.2 from/to central (https://repo1.maven.org/maven2/): /.m2/repository/lein-midje/lein-midje/3.2/lein-midje-3.2.pom.part.lock (No such file or directory)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
bash-5.0$ exit
When the user DOES NOT exist in the container (i.e. nobody):
Given the behaviour observed below, I'm assuming leningen is obtaining the user's home from getent or similar path instead of relying (or even considering) ${HOME}.
Using a docker container with an arbitrary runtime user, the following behaviour is observed:
When the user exists in the container (i.e. nobody):
lein install
will (try to) download dependencies to: <user's home>/.m2Expected failure due to perms in /:
When the user DOES NOT exist in the container (i.e. nobody):
lein install
will download dependencies to the following path:Successfully downloaded to the wrong place:
Build run-time dockerfile:
Test project: