Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Dockerfile Apache
- FROM centos:centos6
- MAINTAINER kaz
- ## yum plugin fastestmirror
- RUN echo "prefer=ftp.iij.ad.jp" >> /etc/yum/pluginconf.d/fastestmirror.conf
- # Time Zone
- RUN echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock
- RUN rm -f /etc/localtime
- RUN ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
- RUN yum clean all
- ## Install
- #RUN yum groupinstall -y 'Base'
- RUN yum install -y sudo openssh-server
- RUN yum install -y httpd mod_ssl
- ## 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 && sleep 5 && /etc/init.d/sshd stop
- ##
- RUN touch /run.sh
- RUN echo -e "#!/bin/bash\n/sbin/service httpd start\n/sbin/service sshd start\n\nwhile true\ndo\n sleep 10\ndone\n" > /run.sh
- RUN chmod u+x /run.sh
- EXPOSE 22 80 443
- CMD ["/run.sh"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement