Newer
Older
dockersand / dockerfiles / dockersand-debian / dockersand-debian.dockerfile
# Dockerfile Docker Sandbox Debian Image

FROM debian
MAINTAINER tundra@tundraware.com

# Update OS and install software

RUN apt-get -y update
RUN apt-get -y install   apt-utils
RUN apt-get -y dist-upgrade
RUN apt-get -y upgrade
RUN apt-get -y install   bzip2 curl dnsutils dos2unix emacs-nox ethtool git \
                         htop joe less lsof netcat net-tools nfs-common \
                         nload openssh-server psmisc python-pip rsync screen \
                         socat sudo silversearcher-ag tree unzip vim whois \
                         wget zip

# Add sandboxes to hosts file

CMD cat common/etc/dockersand.hosts >> /etc/hosts

#  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 chmod 700 /home/test
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 && sleep inf