Dockerfile: Write SSH key stubs later in build
We'd rather duplicate this layer than the package-install layer if a
user is going to use both containerized testnodes and "real" ones.
FROM ubuntu:latest
ARG SSH_PRIVKEY_FILE=id_ed25519
ENV DEBIAN_FRONTEND=noninteractive
-RUN \
- mkdir $HOME/.ssh && \
- touch $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
- chmod 600 $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
- echo "StrictHostKeyChecking=no" > $HOME/.ssh/config && \
- echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
RUN apt-get update && \
apt-get install -y \
git \
@@ -31,6 +25,12 @@ RUN \
mkdir log && \
chmod +x /teuthology/bootstrap && \
./bootstrap
+RUN \
+ mkdir $HOME/.ssh && \
+ touch $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
+ chmod 600 $HOME/.ssh/${SSH_PRIVKEY_FILE} && \
+ echo "StrictHostKeyChecking=no" > $HOME/.ssh/config && \
+ echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
COPY teuthology.sh /
RUN mkdir -p /etc/ansible
COPY ansible_inventory/hosts ansible_inventory/secrets /etc/ansible/
