composer

 

Supported tags and respective Dockerfile links

For detailed information about the published artifacts of each of the above supported tags (image metadata, transfer size, etc), please see the repos/composer directory in the docker-library/repo-info GitHub repo.

For more information about this image and its history, please see the relevant manifest file (library/composer). This image is updated via pull requests to the docker-library/official-images GitHub repo.

What is Composer?

Composer is a tool for dependency management in PHP, written in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

You can read more about Composer in our official documentation.

Using

Run the composer image:

        docker run --rm --interactive --tty 
    --volume $PWD:/app 
    composer install

    

You can mount the Composer home directory from your host inside the Container to share caching and configuration files:

        docker run --rm --interactive --tty 
    --volume $PWD:/app 
    --volume $COMPOSER_HOME:/composer 
    composer install

    

By default, Composer runs as root inside the container. This can lead to permission issues on your host filesystem. You can run Composer as your local user:

        docker run --rm --interactive --tty 
    --volume $PWD:/app 
    --user $(id -u):$(id -g) 
    composer install

    

When you need to access private repositories, you will either need to share your configured credentials, or mount your ssh-agent socket inside the running container:

        docker run --rm --interactive --tty 
    --volume $PWD:/app 
    --volume $SSH_AUTH_SOCK:/ssh-auth.sock 
    --env SSH_AUTH_SOCK=/ssh-auth.sock 
    composer install

    

When combining the use of private repositories with running Composer as another (local) user, you might run into non-existant user errors. To work around this, simply mount the host passwd and group files (read-only) into the container:

        docker run --rm --interactive --tty 
    --volume $PWD:/app 
    --volume $SSH_AUTH_SOCK:/ssh-auth.sock 
    --volume /etc/passwd:/etc/passwd:ro 
    --volume /etc/group:/etc/group:ro 
    --user $(id -u):$(id -g) 
    --env SSH_AUTH_SOCK=/ssh-auth.sock 
    composer install

    

Suggestions

PHP Extensions

We strive to deliver an image that is as lean as possible, aimed at running Composer only.

Sometimes dependencies or Composer scripts require the availability of certain PHP extensions. In this scenario, you have two options:

  • Pass the --ignore-platform-reqs and --no-scripts flags to install or update:

                    docker run --rm --interactive --tty 
       --volume $PWD:/app 
       composer install --ignore-platform-reqs --no-scripts
    
                
  • Create your own image (possibly by extending FROM composer).

Local runtime/binary

If you want to be able to run composer as if it was installed on your host locally, you can define the following function in your ~/.bashrc, ~/.zshrc or similar:

        composer () {
    tty=
    tty -s && tty=--tty
    docker run 
        $tty 
        --interactive 
        --rm 
        --user $(id -u):$(id -g) 
        --volume /etc/passwd:/etc/passwd:ro 
        --volume /etc/group:/etc/group:ro 
        --volume $(pwd):/app 
        composer $@
}

    

License

View license information for the software contained in this image.

Supported Docker versions

This image is officially supported on Docker version 17.04.0-ce.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

User Feedback

Issues

If you have any problems with or questions about this image, please contact us through a GitHub issue. If the issue is related to a CVE, please check for a cve-tracker issue on the official-images repository first.

You can also reach us through the #composer or #docker-library IRC channels on Freenode.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

Documentation

Documentation for this image is stored in the composer/ directory of the docker-library/docs GitHub repo. Be sure to familiarize yourself with the repository’s README.md file before attempting a pull request.

Add to wish list
Demo URL
Current Version
Last Update
Date Created
File Format(s)
File size
Compatible Platform
Requirements
License Type
Languages
Support Options
Documentation
Misc Info
Product Tags
More Questions
Change Log

You must log in and be a buyer of this download to submit a review.

Search

Search
Exact matches only
Search in title
Search in content
Search in comments
Search in excerpt
Filter by Custom Post Type

Details

composer

0 sales

Add to wish list

Download Categories: , , ,
Download Tag:

Your Cart

Newsletter

Sign up to stay tuned and receive special offers!


Subscribe to one or more email lists you want to receive:



You May Also Like

Copyright 2018

wisr

Help-Desk
X
Sign Up

Enter your email and Password

Log In

Enter your Username or email and password

Reset Password

Enter your email to reset your password

X
<-- script type="text/javascript">jQuery('#qt_popup_close').on('click', ppppop);