Dockerfile hinzugefügt
Erste version des Dockerfile. Es wird bereits ein SSH-Key generiert, aber noch keine git-operation ausgeführt.main
commit
9e3d763b6d
|
|
@ -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"]
|
||||
Loading…
Reference in New Issue