Dockerfile hinzugefügt

Erste version des Dockerfile. Es wird bereits ein SSH-Key generiert, aber noch keine git-operation ausgeführt.
main
Andre 2024-03-25 09:46:34 +01:00
commit 9e3d763b6d
1 changed files with 22 additions and 0 deletions

22
Dockerfile Normal file
View File

@ -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"]