]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Dockerfile: Write SSH key stubs later in build
authorZack Cerza <zack@redhat.com>
Fri, 25 Mar 2022 19:24:52 +0000 (13:24 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 28 Mar 2022 21:31:40 +0000 (15:31 -0600)
We'd rather duplicate this layer than the package-install layer if a
user is going to use both containerized testnodes and "real" ones.

Signed-off-by: Zack Cerza <zack@redhat.com>
docs/docker-compose/Dockerfile

index adcf8246154124adea497c6908ab6c020a70b53c..11d6deeb6eb99d40064322f02ead59e467ca9c8c 100644 (file)
@@ -1,12 +1,6 @@
 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/