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.
Please refer to the official Composer documentation for usage details.
From the host via
fin composer --version
From with the cli container (
fin bash) composer can be called directly:
--working-dir= is used, the composer command must be run within the directory or child directory containing the
A composer based Drupal site can require 2GB of RAM to install all components. To provide that RAM to composer inside the container, Virtual Box/Docker Desktop needs 3GB or more.
Starting with v2.12.0 of docksal/cli, Composer v1 and v2 are both installed
in the container. v2 is set as the default version, but while not all projects may be able to work with v2 quite yet,
v1 is available by setting the
COMPOSER_DEFAULT_VERSION variable to
fin config set COMPOSER_DEFAULT_VERSION=1 fin project reset cli
The following Composer optimization packages are no longer relevant for v2 and have been dropped in docksal/cli v2.12.0+:
To benefit from both optimizations with Composer v1, you would need to pin the image to an older version:
# Pick the required (1) PHP version from the list below fin config set CLI_IMAGE='docksal/cli:2.11-php7.2' fin config set CLI_IMAGE='docksal/cli:2.11-php7.3' fin config set CLI_IMAGE='docksal/cli:2.11-php7.4' # Reset cli to apply changes fin project reset cli
Was this page helpful?
Thanks for the feedback. If you have a specific, answerable question about how to use Docksal, ask it in Discussions on GitHub. Open an issue if you want to report a problem or suggest an improvement. You can also contribute changes to this page using the link in the top right corner.