Dockerfile links1.4.2-php7.1, latest1.4.2-php7.01.4.2-php5.6Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
I'm using official image's script as reference, and major PHP versions (5.6, 7.0, and 7.1) as Base Image. This image also use hirak/prestissimo for faster downloads.
Basic usage using current user.
docker run --rm \
--user $(id -u):$(id -g) \
--volume /local/path:/project \
herloct/composer[:tag] [<options>]
Remember to add
--ignore-platform-reqsforinstall,require, andupdatecommand, since this image doesn't add anyext-*other than what php:*-alpine provides.
For example, to install dependencies.
docker run --rm \
--user $(id -u):$(id -g) \
--volume /local/path:/project \
herloct/composer install --ignore-platform-reqs
If you want to cache composer for faster install/update, just add volume to /composer/cache.
docker run --rm \
--user $(id -u):$(id -g) \
--volume /local/path:/project \
--volume /local/composer:/composer/cache \
herloct/composer install --ignore-platform-reqs
/project: Your PHP project directory./composer/cache: Composer cache directory.Content type
Image
Digest
Size
52.5 MB
Last updated
over 9 years ago
docker pull herloct/composer