## Install an SSH of your choice. ADD your_key /tmp/your_key RUN cat /tmp/your_key >> /root/.ssh/authorized_keys && rm -f /tmp/your_key
ubuntuという名前で作業ユーザーを追加します。
FROM phusion/baseimage:0.9.10
# Set correct environment variables. ENV HOME /root
# Regenerate SSH host keys. RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
## Install an SSH of your choice. ADD mykey.pub /tmp/your_key RUN cat /tmp/your_key >> /root/.ssh/authorized_keys \ && chmod 600 /root/.ssh/authorized_keys
# Add User RUN adduser --disabled-password --gecos "" ubuntu RUN mkdir -m 700 /home/ubuntu/.ssh RUN chown ubuntu:ubuntu /home/ubuntu/.ssh RUN cat /tmp/your_key >> /home/ubuntu/.ssh/authorized_keys \ && chmod 600 /home/ubuntu/.ssh/authorized_keys \ && rm -f /tmp/your_key RUNecho"ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ && echo"ubuntu:ubuntu" | chpasswd RUN chown -R ubuntu:ubuntu /home/ubuntu/
CMD ["/sbin/my_init"]
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*