Skip to content

deizel/docker-composer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composer Docker Container

Docker container to install and run Composer.

Features

Installation / Usage

  1. 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-alpha11

  1. 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"
        }
    }
  2. Run Composer through the Composer container:

    $ docker run --rm -v $(pwd):/app composer/composer install

Or run using a specific version of Composer: sh $ docker run --rm -v $(pwd):/app composer/composer:1.0.0-alpha10 install If working with packages installed via git ssh the local .ssh directory shall be mapped into the container: sh $ docker run --rm -v $(pwd):/app -v ~/.ssh:/root/.ssh composer/composer install

  1. Add optional composer command to the host (tested on OS X El Capitan with docker-machine)

Create new composer file sh $ sudo vim /usr/local/bin/composer

The contents of the file will look like this: sh #!/bin/sh export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin echo "Current working directory: '"$(pwd)"'" docker run --rm -v $(pwd):/app -v ~/.ssh:/root/.ssh composer/composer $@

Once the script has been made, it must be set as executable sh $ sudo chmod +x /usr/local/bin/composer

Now the composer command is available native on host: sh $ composer --version

Installation from Source

To run, test and develop the Composer Dockerfile itself, you must use the source directly:

  1. Download the source:

    $ git clone https://github.com/RobLoach/composer-docker.git
  2. Switch to the composer-docker directory:

    $ cd composer-docker
  3. Build the base container (in case of adaptions on the composer base image only)

    $ docker build -t composer/composer:base base
  4. Build the container, using Composer's latest master release:

    $ docker build -t composer/composer:latest master
  5. Test running Composer through the container:

    $ docker run composer/composer help

About

📦 Docker container to install and run Composer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 100.0%