Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - FROM node:10.15.0-stretch
 - WORKDIR /usr/src/app
 - USER root
 - RUN echo 'root:root' | chpasswd
 - # Install dependencies
 - COPY package*.json ./
 - RUN apt-get update
 - RUN apt-get install -y openssh-server
 - RUN mkdir /var/run/sshd
 - RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
 - RUN echo 'PermitRootLogin=without-password' >> /etc/ssh/sshd_config
 - # SSH login fix. Otherwise user is kicked off after login
 - RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
 - RUN sed -ie 's/#PermitUserEnvironment no/PermitUserEnvironment yes/g' /etc/ssh/sshd_config
 - RUN sed -ir 's/#HostKey \/etc\/ssh\/ssh_host_rsa_key/HostKey \/etc\/ssh\/ssh_host_rsa_key/g' /etc/ssh/sshd_config
 - RUN sed -ir 's/#HostKey \/etc\/ssh\/ssh_host_dsa_key/HostKey \/etc\/ssh\/ssh_host_dsa_key/g' /etc/ssh/sshd_config
 - RUN sed -ir 's/#HostKey \/etc\/ssh\/ssh_host_ecdsa_key/HostKey \/etc\/ssh\/ssh_host_ecdsa_key/g' /etc/ssh/sshd_config
 - ## Suppress error message 'Could not load host key: ...'
 - RUN rm -f /etc/ssh/ssh_host_rsa_key
 - RUN rm -f /etc/ssh/ssh_host_dsa_key
 - RUN rm -f /etc/ssh/ssh_host_ecdsa_key
 - RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key
 - RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key
 - RUN ssh-keygen -q -N "" -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
 - RUN chmod 0444 /etc/ssh/*
 - ## Execute SSHD from entrypoint
 - COPY entrypoint.sh /entrypoint.sh
 - RUN chmod +x /entrypoint.sh
 - ENTRYPOINT ["/entrypoint.sh"]
 - ## open ssh port
 - EXPOSE 22
 - USER node
 - # Run
 - CMD ["npm", "start"]
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment