Sign inSign up

geekyouth/sshd

By geekyouth

Updated over 3 years ago

Image
1

113

geekyouth/sshd repository overview

1.0.0

# https://hub.docker.com/r/centos/systemd
FROM centos/systemd

ENV TZ=Asia/Shanghai
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && \
    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
RUN echo "root" | passwd --stdin root
RUN yum -y install openssh openssh-clients openssh-server tzdata wget net-tools; yum clean all; systemctl enable sshd
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

EXPOSE 22

ENTRYPOINT  ["/usr/sbin/init"]

# docker build -t geekyouth/sshd:centos7-sshd-1.0.0 ./.sshd
# docker run -d --privileged --hostname sshd01 --name sshd01 -p 2122:22 --restart always geekyouth/sshd:centos7-sshd-1.0.0
# docker run -d --privileged --hostname sshd02 --name sshd02 -p 2222:22 --restart always geekyouth/sshd:centos7-sshd-1.0.0
# docker run -d --privileged --hostname sshd03 --name sshd03 -p 2322:22 --restart always geekyouth/sshd:centos7-sshd-1.0.0
# docker run -d --privileged --hostname sshd04 --name sshd04 -p 2422:22 --restart always geekyouth/sshd:centos7-sshd-1.0.0
# docker exec -it sshd01 /bin/bash
# ssh root@localhost -p 2122
# docker push geekyouth/sshd:centos7-sshd-1.0.0

# https://medium.com/rahasak/configure-docker-timezone-in-linux-71893fe51499 https://serverfault.com/a/683651/930761

# yum install -y ca-certificates
# vim /etc/ssh/sshd_config # UsePAM no

1.1.0

# https://hub.docker.com/r/centos/systemd
FROM centos/systemd

ENV TZ=Asia/Shanghai

RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && \
    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
RUN echo "root" | passwd --stdin root
RUN yum -y install openssh openssh-clients openssh-server tzdata wget net-tools; \
    yum clean all; systemctl enable sshd;

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

EXPOSE 22
EXPOSE 20000-20020

ENTRYPOINT  ["/usr/sbin/init"]

# docker build -t geekyouth/sshd:centos7-sshd-1.1.0 .
# docker run -d --privileged --hostname sshd11 --name sshd11 -p 1122:22 -p 20000-20020:20000-20020 --expose 22 --expose 20000-20020 --restart always geekyouth/sshd:centos7-sshd-1.1.0
# docker exec -it sshd11 /bin/bash
# ssh root@localhost -p 1122

# docker push geekyouth/sshd:centos7-sshd-1.1.0

# https://medium.com/rahasak/configure-docker-timezone-in-linux-71893fe51499 https://serverfault.com/a/683651/930761
# https://cloud-atlas.readthedocs.io/zh_CN/latest/docker/network/docker_expose_publish_port.html#id2
# https://stackoverflow.com/a/49165016/9633499

# yum install -y ca-certificates
# vim /etc/ssh/sshd_config # UsePAM no

# https://hub.docker.com/r/geekyouth/sshd

# vim /etc/yum.repo/nginx.repo
# [nginx-stable]
  #name=nginx stable repo
  #baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
  #gpgcheck=0
  #enabled=1
  #gpgkey=https://nginx.org/keys/nginx_signing.key
  #module_hotfixes=true
# yum install -y nginx
# vim /etc/nginx/conf.d/default.conf
# server {
#     listen       20018;
# systemctl start nginx # http://${docker-host-ip}:20018 #OK 200

阿里云:Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error - 简书 https://www.jianshu.com/p/2206cb265247

Tag summary

Content type

Image

Digest

sha256:c67aff062

Size

80.6 MB

Last updated

over 3 years ago

docker pull geekyouth/sshd:centos7-sshd-1.1.0