diff --git a/Dockerfile b/Dockerfile index d1dcce9..c91dba2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM phusion/baseimage:latest MAINTAINER Mark Stillwell +# init script to get ssh key from metadata service RUN mkdir -p /etc/my_init.d && \ > /etc/my_init.d/05-setkey echo '#!/bin/bash\n\ ATTEMPTS=30\n\ @@ -11,7 +12,7 @@ chmod 700 /root/.ssh\n\ TMPFILE=$(mktemp)\n\ while [ ! -f /root/.ssh/authorized_keys ] && [ ${ATTEMPTS} -gt 0 ]; do\n\ ATTEMPTS=$((${ATTEMPTS}-1))\n\ - curl -s http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key\\\n\ + curl -sf http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key\\\n\ > ${TMPFILE} 2>/dev/null\n\ if [ $? -eq 0 ]; then\n\ cat ${TMPFILE} >> /root/.ssh/authorized_keys\n\