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..

hello. I need to install module from private repository. And I need to add public ssh key to the CLI

U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

hello. 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

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Something like export GITHUB_TOKEN={your_token_here}.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Or:

    Prepare the GitHub token for accessing private repositories:
    Generate the GitHub token in your GitHub account.
    Add the GITHUB_TOKEN environment variable to your profile in one of the following ways:

    # bash
    touch ~/.bash_profile
    echo -e "\n\nexport GITHUB_TOKEN=your_token" >> ~/.bash_profile
    source ~/.bash_profile
    
    # zsh
    touch ~/.zprofile
    echo -e "\n\nexport GITHUB_TOKEN=your_token" >> ~/.zprofile
    source ~/.zprofile
    
  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    but do i need to do it always when i want to run composer? i would like to have it permanently there πŸ™‚

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Adding it into you bash profile will do the trick.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    and it will go automatically to the cli container always?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Not sure about that, sorry. My answer was about installing packages from private repositories using docker/sdk.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited June 2020

    I would ask in as it's env specific.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok. thanks πŸ™‚

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    and i think we are talking about different things. I need to add ssh key inside of container. Not github token.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Probably. But for installing packages from private repos github token is enough in our case as our development develops in private monorepo.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    this is our internal repo. and i'm getting this error

    Cloning into bare repository /home/spryker/.composer/cache/vcs/blabla...                                                                                  
     Warning: Permanently added '(ECDSA) to the list of known hosts.                                                                                                                           
    repourl: Permission denied (publickey).                                                                                                                                                                        
    fatal: Could not read from remote repository.
    

    So i need public key for this operation i think