docker 配置文件
Dockerfile
# The dockerfile has Change add sshd services on Centos7.0
# centos7:latest image
FROM centos:latest
MAINTAINER Youe<shenzhepei@163.com>
# Install
# epel-release
# sshd net-tools wget git
RUN yum install -y epel-release
RUN yum install openssh-server net-tools wget git vim -y
# Install nodejs
RUN wget http://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.gz
RUN mkdir -p /usr/local/nodejs/nodejs-v8.12.0
RUN tar --strip-components 1 -xzvf node-v* -C /usr/local/nodejs/nodejs-v8.12.0
# Install yarn
RUN wget https://github.com/yarnpkg/yarn/releases/download/v1.7.0/yarn-v1.7.0.tar.gz
RUN mkdir -p /usr/local/yarn
RUN tar -zxvf yarn-v1.7.0.tar.gz -C /usr/local/yarn
RUN mkdir /var/run/sshd
# Set password for root
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# Set history record
ENV HISTTIMEFORMAT "%F %T "
# Set nodejs env
ENV NODE_HOME /usr/local/nodejs/nodejs-v8.12.0
ENV PATH $PATH:${NODE_HOME}/bin
# Set yarn env
ENV PATH $PATH:/usr/local/yarn/yarn-v1.7.0/bin
# Fix sshd service:Read from socket failed: Connection reset by peer?
RUN ssh-keygen -A
# Change timezone CST
RUN \cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# Open port
# 22 ssh
# 80 nginx
EXPOSE 22
EXPOSE 8081
#Auto running sshd service
CMD ["/usr/sbin/sshd","-D"]