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