Public | Automated Build

Last pushed: 4 months ago
Short Description
Docker image for PHP Composer.
Full Description

Supported tags and respective Dockerfile links

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.

https://getcomposer.org/doc/00-intro.md

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.
Docker Pull Command
Owner
herloct
Source Repository

Comments (0)