Last active
January 16, 2022 11:51
-
-
Save SajidK25/e42b54c4cc6f7cd96426073d944e2d9a to your computer and use it in GitHub Desktop.
Multi Stage Dockerfile using sshkey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu as intermidiate | |
RUN apt-get update | |
RUN apt-get install git -y | |
RUN mkdir /root/.ssh/ && \ | |
chmod 700 /root/.ssh | |
COPY id_ed25519 /root/.ssh/id_rsa && \ | |
chmod 600 /root/.ssh/id_rsa | |
RUN touch /root/.ssh/known_hosts | |
RUN ssh-keyscan -t rsa -H github.com >> /root/.ssh/known_hosts | |
# RUN ssh-keyscan -t rsa -H gitlab.com >> /root/.ssh/known_hosts | |
# RUN ssh -T [email protected] | |
RUN git clone [email protected]:SajidK25/Python_CWM.git | |
FROM ubuntu | |
COPY --from=intermidiate /Python_CWM /srv/Python_CWM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment