Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM centos:centos6
- MAINTAINER kaz
- ## yum plugin fastestmirror
- RUN echo "prefer=ftp.iij.ad.jp" >> /etc/yum/pluginconf.d/fastestmirror.conf
- ## Install
- RUN yum groupinstall -y 'Base'
- RUN yum install -y sudo openssh-server
- RUN yum install -y httpd
- RUN yum install -y yum-plugin-priorities.noarch
- RUN rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm
- RUN yum install -y supervisor
- ## create user
- RUN useradd kaz
- RUN passwd -u -f kaz
- RUN mkdir /home/kaz/.ssh; chown kaz. /home/kaz/.ssh; chmod 700 /home/kaz/.ssh
- ADD ./authorized_keys /home/kaz/.ssh/
- RUN chown kaz. /home/kaz/.ssh/authorized_keys
- RUN chmod 600 /home/kaz/.ssh/authorized_keys
- ## sudo
- RUN echo "kaz ALL=(ALL) ALL" >> /etc/sudoers.d/kaz
- ## sshd
- RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
- RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config
- RUN sed -ri 's/#GSSAPIAuthentication no/GSSAPIAuthentication no/' /etc/ssh/sshd_config
- RUN sed -ri 's/GSSAPIAuthentication yes/#GSSAPIAuthentication yes/' /etc/ssh/sshd_config
- RUN /etc/init.d/sshd start
- RUN /etc/init.d/sshd stop
- ## supervisor
- RUN sed -ri 's/nodaemon=false/nodaemon=true/g' /etc/supervisord.conf
- RUN echo -e "[program:sshd]\ncommand=/usr/sbin/sshd -D\nautostart=true\nautorestart=true\n" >> /etc/supervisord.conf
- RUN echo -e "[program:httpd]\ncommand=/bin/bash -c 'source /etc/sysconfig/httpd && exec /usr/sbin/httpd -DFOREGROUND'\n" >> /etc/supervisord.conf
- EXPOSE 22 80
- CMD ["/usr/bin/supervisord"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement