Last active
June 5, 2019 15:25
-
-
Save i-sync/3dd3e2bfd3a6e081b1d29d9b4ded0c67 to your computer and use it in GitHub Desktop.
Costom Ubuntu docker file - sshd python3 nginx etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #build command | |
| docker build -t ubuntu_sshd . | |
| #run command | |
| docker run \ | |
| -d \ | |
| --name ubuntu \ | |
| -p 81:80 \ | |
| -p 22:22 \ | |
| ubuntu_sshd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu | |
| RUN apt update \ | |
| && apt install -y wget curl git net-tools python3 python3-distutils nginx vim htop openssh-server \ | |
| && mkdir -p /root/download && cd /root/download \ | |
| && wget https://bootstrap.pypa.io/get-pip.py \ | |
| && python3 get-pip.py \ | |
| && pip install virtualenv \ | |
| && mkdir -p /var/run/sshd \ | |
| && echo 'root:123' |chpasswd \ | |
| && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config | |
| #&& sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \ | |
| #&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config | |
| EXPOSE 22 | |
| CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment