Merge pull request #64 from archcloudlabs/fixing-docker-error

Optimizing RUN commands and adding Debian Stretch Archive
This commit is contained in:
Kevin Bock 2023-05-18 17:24:14 -04:00 committed by GitHub
commit 6b091060ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,14 @@
FROM python:3.6-stretch
# Set the root password in the container so we can use it
RUN echo "root:Docker!" | chpasswd
RUN apt-get -y update
RUN apt-get -y install libnetfilter-queue-dev iptables tcpdump netcat net-tools git graphviz openssh-server
ENV PATH="/usr/sbin:${PATH}"
RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list
RUN apt-get -y update && \
apt-get -y install libnetfilter-queue-dev iptables tcpdump netcat net-tools git graphviz openssh-server && \
pip install netfilterqueue requests dnspython anytree graphviz netifaces paramiko tld docker scapy==2.4.3 psutil && \
DEBIAN_FRONTEND=noninteractive apt-get -y install tshark
# Enable root SSH login for client testing
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
@ -10,8 +16,4 @@ RUN sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install tshark
ENV PATH="/usr/sbin:${PATH}"
RUN pip install netfilterqueue requests dnspython anytree graphviz netifaces paramiko tld docker scapy==2.4.3 psutil
ENTRYPOINT ["/bin/bash"]