I need to add an SSH key to run inside my DDEV Docker container

171 views Asked by At

I have just pulled a repo from BitBucket and attempted to run 'composer install' from inside my docker terminal.

The composer.json file has additional respository dependancies which need to be pulled from 'BitBucket' as part of the composer build. I'm getting errors as my private keys aren't available in the docker container.

How do I resolve this?

Note- I don't want to install composor or PHP on my local machine

I haven't been able to find clear instructions on how to make SSH available to my docker container OR how to install an SSH key purely for use in the docker container

1

There are 1 answers

0
rfay On

DDEV supports ddev auth ssh, which allows all of your keys on the host side to be used inside the web container. This is often used for private composer repositories.

Please see the docs that explain how to use ssh keys inside the container.

For more unusual situations, see https://stackoverflow.com/a/61485062/215713 - that one explains how you can actually put your keys inside the container if that's the only thing that works for you.