Sign inSign up

willhallonline/composer

By willhallonline

Updated over 7 years ago

Dockerised solution for building composer

Image
1

6.9K

willhallonline/composer repository overview

Docker Composer

Docker Pulls MicroBadger Layers Docker Automated build Docker 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.

This is a Dockerised Solution for running Composer.

Docker Commands

Pull
$  docker pull willhallonline/composer
$  docker pull willhallonline/composer:stretch
$  docker pull willhallonline/composer:apache
Run
Composer Running
$  docker run -it --rm -v $(pwd):/app willhallonline/composer --version
Composer version 1.7.2 2018-08-16 16:57:12
Composer Require Package
$  docker run --rm -it -v $(pwd):/app willhallonline/composer:alpine composer require guzzlehttp/guzzle
Using version ^6.3 for guzzlehttp/guzzle
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
  - Installing guzzlehttp/promises (v1.3.1): Downloading (100%)         
  - Installing psr/http-message (1.0.1): Downloading (100%)         
  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)         
  - Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)         
guzzlehttp/guzzle suggests installing psr/log (Required for using the Log middleware)
Writing lock file
Generating autoload files

Will create:

composer.json
composer.lock
vendor/  # vendor packages installed here
Composer Install

Providing you already have composer.json (and maybe composer.lock)

docker run --rm -it -v $(pwd):/app willhallonline/composer:alpine composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 4 installs, 0 updates, 0 removals
  - Installing psr/http-message (1.0.1): Downloading (100%)         
  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)         
  - Installing guzzlehttp/promises (v1.3.1): Downloading (100%)         
  - Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)         
guzzlehttp/guzzle suggests installing psr/log (Required for using the Log middleware)
Generating autoload files

Note that this will install files as root user. You can potentially add the -u 1000:1000 options to the command, however, this may introduce other challenges.

Maintainer

Tag summary

Content type

Image

Digest

Size

38.5 MB

Last updated

over 7 years ago

docker pull willhallonline/composer