|
FROM ubuntu:20.04 |
|
USER root |
|
EXPOSE 80 8080 |
|
|
|
RUN whoami && echo "root:zxcvbnm" | chpasswd |
|
|
|
RUN apt update |
|
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && \ |
|
|
|
apt install -y openssh-server openssh-client bash-completion git curl vim |
|
|
|
RUN \ |
|
apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring && \ |
|
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ |
|
| tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null && \ |
|
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ |
|
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \ |
|
| tee /etc/apt/sources.list.d/nginx.list && \ |
|
apt update && apt install -y nginx |
|
|
|
|
|
|
|
|
|
RUN cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak && \ |
|
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config |
|
|
|
|
|
|
|
CMD chown root:root / && sshd -T && service ssh start && service nginx start |