Composer Registry
This page describes how to use the True Composer Registry.
Configure the following in your ~/.composer/config.json
file:
{
"config": {},
"repositories": {
"true_gitlab": {
"type": "composer",
"url": "https://gitlab.true.nl/api/v4/group/20/-/packages/composer/packages.json",
"canonical": false
}
},
"gitlab-domains": [
"gitlab.true.nl"
]
}
To utilize this config from within a Docker container, you can set up docker-compose.override.yaml
as follows:
services:
app:
volumes:
- ~/.composer:/var/www/html/.composer
Note:
Replace /var/www/html
with the home directory of the user in the container e.g. /root
.
When you run composer install
for the first time, it wil ask you for a username and password, these can be created on this page with the read_api
or api
scope.
In case you are not presented with this prompt, create the personal access token, and configure the following in ~/.composer/auth.json
file :
{
"http-basic": {
"gitlab.true.nl": {
"username": "<user name without @true.nl>",
"password": "<Token you created previously>"
}
}
}
Use your SSH-key with ssh-add on a Mac
The first time you'll need to save your passphrase in the keychain with:
ssh-add --apple-load-keychain
After every reboot you'll need to load you key back into the ssh-agent with:
ssh-add --apple-use-keychain
Configure ssh-agent passthrough in docker-compose.override.yaml
services:
app:
volumes:
- type: bind
source: /run/host-services/ssh-auth.sock
target: /run/host-services/ssh-auth.sock
environment:
SSH_AUTH_SOCK: /run/host-services/ssh-auth.sock