nexus community also provides php composer PW (currently still in development, there is no ga), tests using the constructed image docker
Preparing the Environment
- docker-compose documents
version: "3"
services:
nexus:
image: jbuncle/nexus-repository-composer:2.0.0
volumes:
- "./nexus-data:/nexus-data"
ports:
- "8081:8081"
- start up
docker-compose up -d
- Configuring nexus
follow the prompts can be very simple - Adding composer proxy
use
- Installation Composer
mac system
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
- Initialization composer project
composer.json file
{
"config": {
"secure-http": false
},
"require": {
"monolog/monolog": "1.0.*"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "http://localhost:8081/repository/demo/"
}
}
}
- Installation depends
composer install
- effect
nexus local cache
Explanation
In the test proxy Ali cloud, as well as several domestic Huawei cloud mirrored found no success, but there is no question of direct agency official
Reference material
https://hub.docker.com/r/jbuncle/nexus-repository-composer
https://pkg.phpcomposer.com/
https://getcomposer.org/doc/06-config.md#secure-http
https://packagist.org/mirrors