Sign inSign up

herloct/composer

By herloct

Updated over 9 years ago

Docker image for PHP Composer.

Image
0

8.2K

herloct/composer repository overview

license Build Status

What is Composer?

Composer 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.

Is it better than official Composer images?

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.

How to use this image

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-reqs for install, require, and update command, since this image doesn't add any ext-* 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

Volumes

  • /project: Your PHP project directory.
  • /composer/cache: Composer cache directory.

Tag summary

Content type

Image

Digest

Size

52.5 MB

Last updated

over 9 years ago

docker pull herloct/composer