Composer

PHP Packages: Composer

Docker Composer

Install package

docker run --rm --interactive --tty \
  --volume $PWD:/app \
  composer:1.9.3 require psr/log "^1.0"

dump-autoload

docker run --rm --interactive --tty \
  --volume $PWD:/app \
  composer:1.9.3 dump-autoload

Docker Composer with GD library

FROM composer:1.9.3

# Install required packages
RUN apk --no-cache add php7-gd freetype-dev libjpeg-turbo-dev libpng-dev


RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
  && docker-php-ext-install -j "$(nproc)" gd

Reference


Autoload

PHP Packages: Composer Autoload

Custom docker composer image

PHP Packages: Composer Custom docker composer image