Allow key generation to suceed even if container doesn't have internet connectivity.

This commit is contained in:
Marco Slater 2019-05-11 19:48:07 +01:00
parent 93c49c1625
commit a3dc24aee2
2 changed files with 1 additions and 1 deletions

View File

@ -9,6 +9,7 @@ FROM debian:latest
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
RUN apt-get update && apt-get install openssh-client -y && apt-get clean
COPY --from=0 /ssh-chat/ssh-chat /ssh-chat COPY --from=0 /ssh-chat/ssh-chat /ssh-chat

View File

@ -4,7 +4,6 @@ if [ -f ssh_key ]; then
/ssh-chat -i /ssh_key $@ /ssh-chat -i /ssh_key $@
else else
echo "SSH Key not found at /ssh_key. Generating..." echo "SSH Key not found at /ssh_key. Generating..."
apt-get update > /dev/null && apt-get install openssh-client -y > /dev/null 2>&1
ssh-keygen -t rsa -b 4096 -f /ssh_key -q -N '' ssh-keygen -t rsa -b 4096 -f /ssh_key -q -N ''
/ssh-chat -i /ssh_key $@ /ssh-chat -i /ssh_key $@
fi fi