Create a Docker image:
docker build --build-arg ssh_prv_key="$(cat ~/.ssh/id_rsa)" --build-arg ssh_pub_key="$(cat ~/.ssh/id_rsa.pub)" -t clojure-private-git-deps:test .
Run the docker container with an interactive bash shell:
docker run -it clojure-private-git-deps:test bash
Start a Clojure REPL with your private Clojure module:
clojure -Sdeps '{:deps {me/module {:git/url "[email protected]:me/module.git" :sha "2aa1c686760cff280b7b65b825a4321bdb8de53e"}}}'
Voila!
As of now, GitHub, GitLab, and BitBucket hosts are supported as sources of private Git repositories.
To configure another host for git repositories add a line to Dockerfile:
RUN ssh-keyscan your-git.host >> /root/.ssh/known_hosts
The solution is based on an infinite amount of Googling and these online resources: