Skip to content

Instantly share code, notes, and snippets.

@kechol
Last active January 24, 2016 20:10
Show Gist options
  • Save kechol/040fee4bacd035823614 to your computer and use it in GitHub Desktop.
Save kechol/040fee4bacd035823614 to your computer and use it in GitHub Desktop.
Dockerfile for kechol/ansible-playground
FROM ubuntu
MAINTAINER kechol
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y software-properties-common python-software-properties
RUN apt-add-repository -y ppa:ansible/ansible
RUN apt-get update
RUN apt-get install -y ssh ansible
RUN mkdir -p -m0755 /var/run/sshd
RUN /usr/sbin/sshd
RUN adduser --disabled-password --gecos "" ubuntu
RUN sudo -u ubuntu ssh-keygen -q -t rsa -N "" -f /home/ubuntu/.ssh/id_rsa
RUN sudo -u ubuntu cp /home/ubuntu/.ssh/id_rsa.pub /home/ubuntu/.ssh/authorized_keys
RUN chmod 400 /home/ubuntu/.ssh/*
RUN echo 'ubuntu ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers
RUN cp -r /home/ubuntu/.ssh /root/.ssh
RUN chown -R root:root /root/.ssh
RUN chmod 400 /root/.ssh/id_rsa
ADD ./playbook /opt/playbook
EXPOSE 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment