Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

hi guys. I need to install module from private repository. And I need to add public ssh key to the C

Options
U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

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.

Comments

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Hello Alex,

    Is that about GitLab, GitHub or Bitbucket?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet
    edited June 2020
    Options

    @ULYHPR789 this is about gitlab

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    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.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet
    Options

    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.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    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.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    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:

    COMPOSER_AUTH="{"github-oauth":{"[github.com](http://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.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited July 2020
    Options

    @UPZH5HHEV I assume we need to update the documentation. Or implement the SSH supporting feature.