1
- # Use an official Clojure runtime as a parent image
2
1
FROM clojure:temurin-17-lein-bullseye
3
-
4
- # Set environment variables to non-interactive (this prevents some prompts)
5
2
ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Define environment variable for nREPL port
8
3
ENV NREPL_PORT=7888
9
4
10
5
RUN apt-get update \
@@ -21,7 +16,6 @@ RUN locale-gen en_US.UTF-8
21
16
RUN locale-gen en en_US en_US.UTF-8
22
17
RUN dpkg-reconfigure locales
23
18
24
- # Set root password
25
19
RUN echo 'root:cider' | chpasswd
26
20
27
21
RUN sed -i 's/^#* *PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config
@@ -31,31 +25,20 @@ RUN sed -i 's/^#* *ChallengeResponseAuthentication .*/ChallengeResponseAuthentic
31
25
# SSH login fix. Otherwise user is kicked off after login
32
26
RUN sed 's@session\s *required\s *pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
33
27
34
- # Expose SSH port
35
28
EXPOSE 22
36
29
37
30
CMD ["/usr/sbin/sshd" , "-D" ]
38
31
39
- # Set the working directory in the docker image
40
32
WORKDIR /usr/src/app
41
33
42
- # Copy the current directory contents into the directory at /usr/src/app in the image
43
34
COPY . /usr/src/app
44
35
45
- # Install any needed packages specified in project.clj
46
36
RUN lein deps
47
37
48
- # Forward all relevant env vars for ssh sessions
49
38
RUN echo "export JAVA_HOME=${JAVA_HOME}" >> /root/.bashrc
50
39
RUN echo "export LEIN_HOME=${LEIN_HOME}" >> /root/.bashrc
51
40
RUN echo "export LEIN_JAVA_CMD=${LEIN_JAVA_CMD}" >> /root/.bashrc
52
41
RUN echo "export LEIN_JVM_OPTS=${LEIN_JVM_OPTS}" >> /root/.bashrc
53
42
RUN echo "export LEIN_ROOT=${LEIN_ROOT}" >> /root/.bashrc
54
43
RUN echo "export NREPL_PORT=${NREPL_PORT}" >> /root/.bashrc
55
44
RUN echo "export PATH=${PATH}" >> /root/.bashrc
56
-
57
- # Make port 7888 available to the world outside this container (nREPL default port)
58
- # EXPOSE 7888
59
-
60
- # Run lein repl when the container launches, on port defined by NREPL_PORT
61
- # CMD ["lein", "repl", ":headless", ":host", "0.0.0.0", ":port", "7888"]
0 commit comments