Newer
Older
dockersand / dockerfiles / dockersand-centos7 / dockersand-centos7.dockerfile
  1. # Dockerfile For CentOS7 Docker Sandbox
  2.  
  3. FROM centos:7
  4. MAINTAINER tundra@tundraware.com
  5.  
  6. # Update OS and install software
  7.  
  8. RUN yum -y upgrade
  9. RUN yum -y install epel-release
  10. RUN yum -y install bind-utils bzip2 dos2unix emacs-nox git htop joe lsof nc nload \
  11. net-tools openssh-server psmisc python2-pip python3 python3-pip \
  12. screen socat sudo the_silver_searcher tree which wget zip
  13. RUN yum clean all
  14.  
  15. # Enable sshd with same keys each time
  16. ADD common/keys/ /etc/ssh/
  17. RUN mkdir /var/run/sshd
  18.  
  19. # Setup and configure user: root
  20.  
  21. ADD common/.ssh/ /root/.ssh/
  22. RUN chmod 700 /root
  23. RUN mkdir /root/tmp
  24. RUN chown -R root:root /root
  25. RUN chmod 700 /root/.ssh
  26. RUN chmod 600 /root/.ssh/authorized_keys
  27. RUN chmod 600 /root/.ssh/*rsa
  28.  
  29. # Setup and configure user: test
  30.  
  31. RUN useradd -m -p snLOSb4wiVD0k -u 1000 -s /bin/bash test
  32. ADD common/.ssh/ /home/test/.ssh/
  33. RUN mkdir /home/test/tmp
  34. RUN chown -R test:test /home/test
  35. RUN chmod 700 /home/test/.ssh
  36. RUN chmod 600 /home/test/.ssh/authorized_keys
  37. RUN chmod 600 /home/test/.ssh/*rsa
  38.  
  39. # Configure sudo
  40.  
  41. RUN echo "test ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
  42.  
  43. # Start sshd on instantiation
  44.  
  45. ENTRYPOINT /usr/sbin/sshd && sleep inf