Skip to content

Instantly share code, notes, and snippets.

@kazuph

kazuph/Dockerfile

Last active Feb 9, 2020
Embed
What would you like to do?
centosのimageからsshを使えるようにするだけのDockerfile。
FROM centos
RUN yum install -y passwd
RUN yum install -y openssh
RUN yum install -y openssh-server
RUN yum install -y openssh-clients
RUN yum install -y sudo
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 /etc/init.d/sshd start
RUN /etc/init.d/sshd stop
RUN echo 'root:docker' |chpasswd
RUN useradd docker
RUN echo 'docker:docker' |chpasswd
RUN echo "docker ALL=(ALL) ALL" >> /etc/sudoers.d/docker
EXPOSE 22
CMD /usr/sbin/sshd -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.