hi guys. I need to install module from private rep...
# docker
l
hi guys. I need to install module from private repository. And I need to add public ssh key to the CLI docker container. How can I do it? How can add this key when entering CLI container using 
docker/sdk cli
 ? thanks.
h
Hello Alex, Is that about GitLab, GitHub or Bitbucket?
l
@high-pencil-62400 this is about gitlab
h
Unfortunately, docker/sdk does not support SSH forwarding at the moment. We are planning to use https://docs.docker.com/develop/develop-images/build_enhancements/#using-ssh-to-access-private-data-in-builds in one of the next features. However I cannot tell the estimations. The only workaround I see is to change composer.json: https://getcomposer.org/doc/06-config.md#gitlab-token. Please, try and share your XP. Thanks.
l
i don';t need any ssh forawarding. I just need to add a volume which will map my host ssh key into the container. I didn't know where to add this volume. But now i found a place and all good.
h
It is good for workaround. However, we in Spryker cannot force people to mount private folders inside containers. We will try to solve it different way. Thanks for your XP.
I have new information regarding the topic. Actually docker/sdk supports (for a long time) access to private repository using composer OOTB functionality: COMPOSER_AUTH env variable. So the only thing you need is to export/provide the env variable before running docker/sdk. Like this:
Copy code
COMPOSER_AUTH="{"github-oauth":{"<http://github.com|github.com>":"…"}}"
For gitlab, bitbucket or another, please, refer to composer docs. Also you would need to provide .known_hosts file (in project root) that contains all hosts line-break-separated. This will work for building images and CLI. However this method is not secure. As tokens are left in docker image logs. So the plan is to deprecate it, but only after other ways are provided.
@plain-barista-64036 I assume we need to update the documentation. Or implement the SSH supporting feature.