magento / magento/magento-cloud-docker
Cannot override PHP_EXTENSIONS environment variable
- Dominant language
- PHP
- Stars
- 277
- Forks
- 187
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions
1. Generate a `docker-compose.yml` file with the following command:
`./vendor/bin/ece-docker 'build:compose' --with-entrypoint --with-xdebug --set-docker-host --no-os --db='10.4' --php='7.4' --redis='6.0' --expose-db-port=3307 --mode=developer --sync-engine=native --es='7.11' --rmq='3.9''`
### Steps to reproduce
1. Create a `docker-compose.override.yml` file
2. Override the `generic` service environment variables to add `imagick` to the `PHP_EXTENSIONS` list
3. Log into the container with `bin/magento-docker bash`
4. Output the environment variable with a `echo $PHP_EXTENSIONS`
### Expected result
1. The `PHP_EXTENSIONS` should contain `imagick`
### Actual result
1. The `PHP_EXTENSIONS` matches the `docker-compose.yml` file and not the overridden one.
### Additional information
If the `docker-compose.yml` file is updated to add imagick, then it works, which proves that the `docker-compose.override.yml` isn't taken into account for these environment variable.
I also had the same issue with the `SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025` environment variable that I was forced to declare in the original `docker-compose.yml` as it wasn't working if declared in the `docker-compose.override.yml` file...
Contributor guide
Research direction
Start with the generated docker-compose.yml and docker-compose.override.yml from the documented build:compose command, then inspect how the generic service environment is assembled. Reproduce the PHP_EXTENSIONS and SENDMAIL_PATH overrides with bin/magento-docker bash and verify that the container reflects values from the override file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, php
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100