ccyunchina-deploy/dockerfiles/ansible/Dockerfile

10 lines
498 B
Docker

FROM centos
RUN yum install centos-release-ansible-29 -y && yum install ansible openssh-server openssh-clients -y
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' && ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N "" && ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" &&\
ssh-keygen -t rsa -N '' -f /root/.ssh/id_rsa && cat /root/.ssh/id_rsa.pub >/root/.ssh/authorized_keys
RUN chmod +x -R /usr/bin/
ENV LANG C.UTF-8
RUN echo "/usr/sbin/sshd" >>/root/.bash_profile