Docker container to install and run Composer.
- Composer
- Latest snapshot (
master
) 1.0.0-alpha9
1.0.0-alpha8
- Latest snapshot (
- PHP 5.6
-
Install the
composer/composer
container:$ docker pull composer/composer
Alternatively, pull a specific version of composer/composer
:
sh $ docker pull composer/composer:1.0.0-alpha9
-
Create a composer.json defining your dependencies. Note that this example is a short version for applications that are not meant to be published as packages themselves. To create libraries/packages please read the documentation.
{ "require": { "monolog/monolog": ">=1.0.0" } }
-
Run Composer through the Composer container:
$ docker run -v $(pwd):/app composer/composer install
Or run using a specific version of Composer:
sh $ docker run -v $(pwd):/app composer/composer:1.0.0-alpha9 install
To run, test and develop the Composer Dockerfile itself, you must use the source directly:
-
Download the source:
$ git clone https://github.com/RobLoach/composer-docker.git
-
Switch to the
composer-docker
directory:$ cd composer-docker
-
Build the container, using Composer's latest
master
release:$ docker build -t composer/composer master
-
Test running Composer through the container:
$ docker run composer/composer help