File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change 11FROM fedora:latest
22
3- RUN dnf install -y openssh-server wget
3+ RUN dnf check-update || true && \
4+ dnf install -y openssh-server wget && \
5+ dnf clean all && \
46
5- RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
6- RUN sed -i 's/#AllowTcpForwarding yes/AllowTcpForwarding yes/' /etc/ssh/sshd_config
7+ # Configuring ssh config
8+ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
9+ sed -i 's/#AllowTcpForwarding yes/AllowTcpForwarding yes/' /etc/ssh/sshd_config && \
710
8- RUN ssh-keygen -A
11+ # Generating ssh keys
12+ ssh-keygen -A && \
913
10- RUN echo "root:foobar" | chpasswd
14+ # Changing root password
15+ echo "root:foobar" | chpasswd
1116
1217EXPOSE 5670
13- CMD ["/usr/sbin/sshd" , "-D" , "-p" , "5670" ]
18+
19+ CMD ["/usr/sbin/sshd" , "-D" , "-p" , "5670" ]
Original file line number Diff line number Diff line change 11FROM fedora:latest
22
3- RUN dnf install -y openssh-server
3+ RUN dnf check-update || true && \
4+ dnf install -y openssh-server && \
5+ dnf clean all && \
46
5- RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
6- RUN sed -i 's/#AllowTcpForwarding yes/AllowTcpForwarding yes/' /etc/ssh/sshd_config
7+ # Configuring ssh config
8+ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
9+ sed -i 's/#AllowTcpForwarding yes/AllowTcpForwarding yes/' /etc/ssh/sshd_config && \
710
8- RUN ssh-keygen -A
11+ # Generating ssh keys
12+ ssh-keygen -A && \
913
10- RUN echo "root:foobar" | chpasswd
14+ # Changing root password
15+ echo "root:foobar" | chpasswd
1116
1217# TODO: expose only on an isolated docker network to avoid conflicts?
1318# Think about how extension would communicate
1419EXPOSE 5671
15- CMD ["/usr/sbin/sshd" , "-D" , "-p" , "5671" ]
20+
21+ CMD ["/usr/sbin/sshd" , "-D" , "-p" , "5671" ]
You can’t perform that action at this time.
0 commit comments