Hi I have a secured composer library, that requir...
# docker
a
Hi I have a secured composer library, that requires an ssh key to access it from gitlab, how do I add a key to my docker setup that allows me to get the library without getting this error:
Copy code
[RuntimeException]                                                                                                                                                    
Failed to execute git clone --mirror -- '<mailto:git@gitlab.xxxxxxxxxxx.de|git@gitlab.xxxxxxxxxxx.de>:xxxxx/xxxxx.git' '/home/spryker/.composer/cache/vcs/xxxxxxxx.git/'                                                                                                                                            
                                                                                                                                                                      
Cloning into bare repository '/home/spryker/.composer/cache/vcs/xxxxxxxx.git/' ...                                           
<mailto:git@gitlab.xxxxxxxxxxx.de|git@gitlab.xxxxxxxxxxx.de>: Permission denied (publickey).                                                                                                               
fatal: Could not read from remote repository.                                                                                                                         
                                                                                                                                                                      
Please make sure you have the correct access rights                                                                                                                   
and the repository exists.
s
1. Use HTTPS instead of SSH for your private repositories in
composer.json
2. Create a GitLab token for yourself with
read_api
and
read_repository
permissions. 3. Run
composer config gitlab-token.<your-repo-server> <your-access-token>
4. This will create an
auth.json
file which should be added to .gitignore etc. Additionally, if you build your own Docker containers, you can add this to your RUN line that will pull in all dependencies:
RUN --mount=type=secret,id=gitlab,uid=1000,dst=/data/auth.json
Hope this helps.
a
Hi Thomas .. where can I run (3)
on my local host? or should I add it to the sdk config somehow?
s
For example from within the docker/sdk. You only need to do this once after cloning the project (in fact every project member will need to do 2 and 3 exactly once, so adding this to your README will be good for sure).
docker/sdk cli composer ...
a
oh I see thanks