Skip to content

Composer cache gets cleared everytime #361

Open
@Axel29

Description

Preconditions

  1. Magento Cloud Docker with PHP >= 8.1

Steps to reproduce

  1. Executing any Docker command within a PHP container such as bin/magento-docker bash
  2. Check out the output

Expected result

  1. No cache is cleared

Actual result

  1. Full composer cache gets cleared

Additional information

This is due to the fact that the docker-entrypoint.sh has the following lines now:

# Configure composer
[ ! -z "${COMPOSER_VERSION}" ] && \
    composer clearcache && \
    composer self-update $COMPOSER_VERSION

because of that, Composer's cache is always cleared when the COMPOSER_VERSION environment variable is set.

This is very annoying since by default the local (host machine) Composer cache directory is a volume to the Docker's Composer cache directory, meaning that Magento Cloud Docker would clear the entire Composer cache everytime we run any command that runs the PHP container...

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions