Created
April 6, 2026 01:37
-
-
Save Neboer/f03e3284dec2be2497dd196875f98345 to your computer and use it in GitHub Desktop.
chinese-ubuntu-docker
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 registry.neboer.site/library/ubuntu:22.04 | |
| ENV container=docker \ | |
| DEBIAN_FRONTEND=noninteractive \ | |
| TZ=Asia/Shanghai \ | |
| LANG=C.UTF-8 \ | |
| LC_ALL=C.UTF-8 | |
| RUN set -eux; \ | |
| cat > /etc/apt/sources.list <<'EOF' | |
| deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse | |
| deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse | |
| deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse | |
| deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse | |
| EOF | |
| RUN set -eux; \ | |
| ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime; \ | |
| echo "${TZ}" > /etc/timezone; \ | |
| apt-get update; \ | |
| apt-get install -y --no-install-recommends \ | |
| systemd \ | |
| systemd-sysv \ | |
| openssh-server \ | |
| vim \ | |
| tzdata \ | |
| ca-certificates; \ | |
| rm -rf /var/lib/apt/lists/* | |
| RUN set -eux; \ | |
| mkdir -p /var/run/sshd /run/systemd; \ | |
| mkdir -p /root/.ssh; \ | |
| chmod 700 /root/.ssh; \ | |
| sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config; \ | |
| sed -ri 's/^#?PasswordAuthentication\s+.*/PasswordAuthentication no/' /etc/ssh/sshd_config; \ | |
| grep -q '^PubkeyAuthentication yes$' /etc/ssh/sshd_config || echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config; \ | |
| ssh-keygen -A; \ | |
| systemctl enable ssh.service | |
| EXPOSE 22 | |
| STOPSIGNAL SIGRTMIN+3 | |
| CMD ["/sbin/init"] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use these params: