-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_standalone
66 lines (48 loc) · 1.94 KB
/
Dockerfile_standalone
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Use Python 3.10.4-bullseye as a base image
FROM python:3.10.4-bullseye
# Define shell
SHELL ["/bin/bash", "-c"]
# Update the packages list and install the required packages
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
git \
openssh-server \
openssh-client \
net-tools \
sudo
# Clone the repository and install the required Python packages
RUN cd / && \
git clone -b develop https://github.com/DUNE-DAQ/druncschema.git && \
cd druncschema && \
pip install -r requirements.txt && \
pip install .
RUN cd / && \
git clone -b develop https://github.com/DUNE-DAQ/drunc.git && \
cd drunc && \
pip install -r requirements.txt && \
pip install .
RUN cd /etc/ssh/ && ssh-keygen -A
RUN echo 'root:r00t' | chpasswd
# Update the SSHD configuration to allow root login without password
RUN printf "\nPermitRootLogin without-password\n" >> /etc/ssh/sshd_config && \
printf "Port 23\n" >> /etc/ssh/sshd_config
RUN printf " Port 23\n" >> /etc/ssh/ssh_config && \
printf " StrictHostKeyChecking no\n" >> /etc/ssh/ssh_config && \
printf " PasswordAuthentication no\n" >> /etc/ssh/ssh_config && \
printf " UserKnownHostsFile /dev/null\n" >> /etc/ssh/ssh_config && \
printf " AddressFamily inet" >> /etc/ssh/ssh_config
RUN mkdir /run/sshd
RUN adduser --shell /bin/bash --ingroup sudo patreides
RUN echo 'patreides:chani' | chpasswd
RUN usermod -aG sudo patreides
RUN service ssh start
# Expose SSH port (which was changed from 22 to 23 a couple of lines above)
EXPOSE 23
EXPOSE 10054
USER patreides
WORKDIR /home/patreides
RUN mkdir /home/patreides/.ssh
RUN ssh-keygen -f /home/patreides/.ssh/id_rsa -q -N ""
RUN cp /home/patreides/.ssh/id_rsa.pub /home/patreides/.ssh/authorized_keys
# Run SSHD in the background and drunc-process-manager in the foreground
ENTRYPOINT echo 'chani' | sudo -S service ssh start && drunc-process-manager /drunc/data/process-manager-pocket.json