Skip to content

Commit

Permalink
script should fail on 404...
Browse files Browse the repository at this point in the history
  • Loading branch information
marklee77 committed Nov 4, 2014
1 parent fcbe549 commit 4a571d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM phusion/baseimage:latest
MAINTAINER Mark Stillwell <[email protected]>

# 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\
Expand All @@ -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\
Expand Down

0 comments on commit 4a571d5

Please sign in to comment.