liuyuqi-dellpc 6 years ago
commit
a0f3f9bb31
3 changed files with 81 additions and 0 deletions
  1. 19 0
      Dockerfile
  2. 13 0
      README.md
  3. 49 0
      sources.list

+ 19 - 0
Dockerfile

@@ -0,0 +1,19 @@
+FROM daocloud.io/library/ubuntu:18.10
+#sources.list添加阿里云镜像
+ADD sources.list /root/sources.list
+# RUN cp /root/sources.list  /etc/apt/sources.list.d/aliyun.list
+RUN cp /root/sources.list  /etc/apt/sources.list
+RUN apt-get update
+
+LABEL Name=github.com/jianboy/ubuntu-ssh Version=18.10
+
+#安装ssh
+RUN apt-get install -y openssh-server
+RUN mkdir -p /var/run/sshd
+#默认用户名密码 root:password
+RUN echo 'root:password' | chpasswd
+RUN sed -ri 's/^#PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
+RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd", "-D"]

+ 13 - 0
README.md

@@ -0,0 +1,13 @@
+## ubuntu-ssh
+
+根据 Dockerfile 构建镜像,实现 ssh 登录容器的功能:
+
+```
+docker build -t git.yoqi.me/docker/ubuntu-ssh:18.10 .
+```
+
+启动容器:
+
+```
+docker run --rm -it -p 2223:22/tcp ubuntu-ssh:18.10
+```

+ 49 - 0
sources.list

@@ -0,0 +1,49 @@
+# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
+# newer versions of the distribution.
+deb http://mirrors.aliyun.com/ubuntu/ cosmic main restricted
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic main restricted
+
+## Major bug fix updates produced after the final release of the
+## distribution.
+deb http://mirrors.aliyun.com/ubuntu/ cosmic-updates main restricted
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-updates main restricted
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team. Also, please note that software in universe WILL NOT receive any
+## review or updates from the Ubuntu security team.
+deb http://mirrors.aliyun.com/ubuntu/ cosmic universe
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic universe
+deb http://mirrors.aliyun.com/ubuntu/ cosmic-updates universe
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-updates universe
+
+## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
+## team, and may not be under a free licence. Please satisfy yourself as to
+## your rights to use the software. Also, please note that software in
+## multiverse WILL NOT receive any review or updates from the Ubuntu
+## security team.
+deb http://mirrors.aliyun.com/ubuntu/ cosmic multiverse
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic multiverse
+deb http://mirrors.aliyun.com/ubuntu/ cosmic-updates multiverse
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-updates multiverse
+
+## N.B. software from this repository may not have been tested as
+## extensively as that contained in the main release, although it includes
+## newer versions of some applications which may provide useful features.
+## Also, please note that software in backports WILL NOT receive any review
+## or updates from the Ubuntu security team.
+deb http://mirrors.aliyun.com/ubuntu/ cosmic-backports main restricted universe multiverse
+# deb-src http://mirrors.aliyun.com/ubuntu/ cosmic-backports main restricted universe multiverse
+
+## Uncomment the following two lines to add software from Canonical's
+## 'partner' repository.
+## This software is not part of Ubuntu, but is offered by Canonical and the
+## respective vendors as a service to Ubuntu users.
+# deb http://archive.canonical.com/ubuntu cosmic partner
+# deb-src http://archive.canonical.com/ubuntu cosmic partner
+
+deb http://security.ubuntu.com/ubuntu/ cosmic-security main restricted
+# deb-src http://security.ubuntu.com/ubuntu/ cosmic-security main restricted
+deb http://security.ubuntu.com/ubuntu/ cosmic-security universe
+# deb-src http://security.ubuntu.com/ubuntu/ cosmic-security universe
+deb http://security.ubuntu.com/ubuntu/ cosmic-security multiverse
+# deb-src http://security.ubuntu.com/ubuntu/ cosmic-security multiverse