Public Repository

Last pushed: 9 months ago
Short Description
基于supervisord构建sshd
Full Description

FROM finance/supervisord
MAINTAINER Andy_xu

#配置相关的ssh需要的文件,以及相关的用户密码
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key ;\
ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key ;\
sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd ;\
mkdir -p /root/.ssh && chown root.root /root && chmod 700 /root/.ssh ;\
sed -ri 's/#Port 22/Port 51899/g' /etc/ssh/sshd_config ;\
echo 'root:redhat' | chpasswd
EXPOSE 51899

#这里只需要将更新的配置文件拷贝进去,最终会继承父进程中的CMD去执行supervisord中定义的服务
ADD supervisord.conf /etc/supervisord.conf

Docker Pull Command
Owner
finance

Comments (1)
xxbandy123
9 months ago

[supervisord]
http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (logging level;default info; others: debug,warn)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)

[supervisorctl]
serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL for a unix socket

#额外管理的服务
[program:sshd]
command = /usr/sbin/sshd -D