0

I'm trying to clone my bitbucket repo using ssh (which works perfectly fine on my local machine) on Airflow to continue executing several scripts. Since the keys are present locally I always get the following error while running my DAG on docker, and I believe the same will happen when running this on the server.

raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['git', 'clone', 'ssh://[email protected]:7999/app.git', 'app']' returned non-zero exit status 128.

How can I mount (or maybe pass) the key onto my docker container as well as the airflow server in order to achieve this cloning step?

2

1 Answer 1

0

Why not just copy over the ssh keys into the docker container?

RUN mkdir -p /root/.ssh

COPY id_rsa /root/.ssh/id_rsa
COPY id_rsa.pub /root/.ssh/id_rsa.pub

RUN chmod 600 /root/.ssh/id_rsa && chmod 644 /root/.ssh/id_rsa.pub

RUN ssh-keyscan -H myrepo.com >> /root/.ssh/known_hosts
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.