FROM ubuntu:precise MAINTAINER me@example.com # Prepare chinese apt mirror - upgrade to latest RUN printf "deb http://mirrors.163.com/ubuntu precise main\ndeb http://mirrors.163.com/ubuntu/ precise universe\n" > /etc/apt/sources.list RUN apt-get update RUN apt-get upgrade -y # Cheat upstart RUN dpkg-divert --local --rename --add /sbin/initctl RUN ln -s /bin/true /sbin/initctl # Install base packages RUN apt-get install -y \ inetutils-ping \ net-tools \ vim \ git \ sudo \ openssh-server \ ssh \ screen \ htop \ dstat \ telnet # For sshd RUN mkdir /var/run/sshd # Set default root pass RUN yes some_passwd | passwd # Network binding EXPOSE 22 CMD ["/usr/sbin/sshd", "-D"]