Dockerfile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. FROM centos:centos6.10
  2. MAINTAINER agapple (jianghang115@gmail.com)
  3. env DOWNLOAD_LINK="http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm"
  4. # install system
  5. RUN \
  6. /bin/cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
  7. echo 'root:Hello1234' | chpasswd && \
  8. groupadd -r admin && useradd -g admin admin && \
  9. yum install -y man && \
  10. yum install -y dstat && \
  11. yum install -y unzip && \
  12. yum install -y nc && \
  13. yum install -y openssh-server && \
  14. yum install -y tar && \
  15. yum install -y which && \
  16. yum install -y wget && \
  17. yum install -y perl && \
  18. yum install -y file && \
  19. ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key && \
  20. ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && \
  21. sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd && \
  22. sed -i -e 's/^#Port 22$/Port 2222/' /etc/ssh/sshd_config && \
  23. mkdir -p /root/.ssh && chown root.root /root && chmod 700 /root/.ssh && \
  24. yum install -y cronie && \
  25. sed -i '/session required pam_loginuid.so/d' /etc/pam.d/crond && \
  26. true
  27. RUN \
  28. touch /var/lib/rpm/* && \
  29. wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie" "$DOWNLOAD_LINK" -O /tmp/jdk-8-linux-x64.rpm && \
  30. yum -y install /tmp/jdk-8-linux-x64.rpm && \
  31. /bin/rm -f /tmp/jdk-8-linux-x64.rpm && \
  32. echo "export JAVA_HOME=/usr/java/latest" >> /etc/profile && \
  33. echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile && \
  34. yum clean all && \
  35. true
  36. CMD ["/bin/bash"]