Change the Composer Registry to Packagist / Composer 中国全量镜像
docker pull meteorlxy/php-composer:latest
.bashrc or .zshrc# Use php-cli via Docker Image
php () {
docker run \
--interactive \
--tty \
--rm \
--user $(id -u):$(id -g) \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume $(pwd):/tmp/php \
-w /tmp/php \
meteorlxy/php-composer \
php "$@"
}
.bashrc or .zshrc# Use composer via Docker Image
composer () {
docker run \
--interactive \
--tty \
--rm \
--user $(id -u):$(id -g) \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume ~/.composer/cache:/composer/cache:rw \
--volume $(pwd):/tmp/composer \
-w /tmp/composer \
meteorlxy/php-composer \
composer "$@"
}
Attention
When running composer install, consider the --ignore-platform-reqs and --no-scripts flags.
The line --volume ~/.composer/cache:/composer/cache:rw will store the cache in your host machine. Delete it if you don't need cache
Content type
Image
Digest
Size
30.6 MB
Last updated
about 8 years ago
docker pull meteorlxy/php-composer