From 9e3d763b6d0beff3c592250c65ca043f81a4b3cb Mon Sep 17 00:00:00 2001 From: Andre Date: Mon, 25 Mar 2024 09:46:34 +0100 Subject: [PATCH] =?UTF-8?q?Dockerfile=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Erste version des Dockerfile. Es wird bereits ein SSH-Key generiert, aber noch keine git-operation ausgeführt. --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5d11819 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM nginx + +# Install git and ssh-keygen +RUN apt-get update && \ + apt-get install -y git openssh-client && \ + rm -rf /var/lib/apt/lists/* + +# Set the path to the SSH key pair +ENV SSH_KEY_PATH=/root/.ssh/id_ed25519 + +# Check if the SSH key pair exists +RUN if [ ! -f "$SSH_KEY_PATH" ]; then \ + ssh-keygen -t ed25519 -N "" -f $SSH_KEY_PATH && \ + echo "Generated SSH key pair:" && \ + cat $SSH_KEY_PATH.pub; \ + else \ + echo "Using existing SSH key pair:" && \ + cat $SSH_KEY_PATH.pub; \ + fi + +# Example command to run when the container starts +CMD ["echo", "Container is running"] \ No newline at end of file