Newer
Older
dockersand / dockerfiles / dockersand-centos7 / dockersand-centos7.dockerfile
# Dockerfile For CentOS7 Docker Sandbox

FROM centos:7
MAINTAINER info@tundraware.com

# Update OS and install software

RUN yum -y upgrade
RUN yum -y install epel-release
RUN yum -y install bind-utils bzip2 dos2unix emacs-nox git htop joe lsof nc nload \
                   net-tools openssh-server psmisc python2-pip python3 python3-pip \
                   screen socat sudo the_silver_searcher tree which wget zip
RUN yum clean all

# Enable sshd with same keys each time
ADD common/keys/ /etc/ssh/
RUN mkdir /var/run/sshd

# Setup and configure user: root

ADD common/.ssh/ /root/.ssh/
RUN chmod 700 /root
RUN mkdir /root/tmp
RUN chown -R root:root /root
RUN chmod 700 /root/.ssh
RUN chmod 600 /root/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/*rsa

# Setup and configure user: test

RUN useradd -m -p snLOSb4wiVD0k -u 1000 -s /bin/bash test
ADD common/.ssh/ /home/test/.ssh/
RUN mkdir /home/test/tmp
RUN chown -R test:test /home/test
RUN chmod 700 /home/test/.ssh
RUN chmod 600 /home/test/.ssh/authorized_keys
RUN chmod 600 /home/test/.ssh/*rsa

# Configure sudo

RUN echo "test    ALL=(ALL)   NOPASSWD: ALL" >>/etc/sudoers

# Start sshd on instantiation

ENTRYPOINT /usr/sbin/sshd -E /var/log/sshd.log && sleep inf