idea / Dockerfile
oulh's picture
retry3
4d126a2
raw
history blame
1.09 kB
FROM ubuntu:20.04
USER root
WORKDIR /root/
EXPOSE 80
COPY start.sh /root/start.sh
# set password
RUN echo "root:zxcvbnm" | chpasswd
# init
RUN apt update && apt install openssh-server -y
# /etc/init.d/ssh start
# RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
# yes | unminimize && \
# apt install -y bash-completion git curl wget vim
# SSH
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak && \
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
# RUN mkdir -p /run/sshd
#ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ''
# COPY ./id_rsa* ~/.ssh/
# mkdir -p /run/sshd
# echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
RUN wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz && \
tar -zxf ngrok-v3-stable-linux-amd64.tgz && \
./ngrok config add-authtoken 2Uym7MToTptND58tapCPscX7UyC_81x66N91ecUQBPyWNqHCC
RUN chmod +x /root/start.sh
CMD ["/bin/bash","/root/start.sh"]
# CMD service ssh start && ./ngrok tcp 22 && tail -f /dev/null
# CMD ["/bin/bash","service ssh start && ./ngrok tcp 22"]