webdevops / Dockerfile

:package: Dockerfiles from WebDevOps for PHP, Apache and Nginx
https://webdevops.io/projects/dockerfiles/
MIT License
1.66k stars 492 forks source link

failing to start #372

Closed calvera closed 3 years ago

calvera commented 3 years ago
Starting up supervisor ...
Log stdout redirected to /proc/1/fd/1
Log stderr redirected to /proc/1/fd/2
-> Executing /opt/docker/provision/entrypoint.d/05-permissions.sh
-> Executing /opt/docker/provision/entrypoint.d/20-nginx.sh
-> Executing /opt/docker/provision/entrypoint.d/20-php-fpm.sh
-> Executing /opt/docker/provision/entrypoint.d/20-php.sh
ln: /usr/local/bin/composer: File exists
htuscher commented 3 years ago

Please provide sufficient information. Which image version are you using, do you have a custom image build on top? How are you starting the image?

calvera commented 3 years ago

i have my own composer in /usr/local/bin, 7.4-alpine

htuscher commented 3 years ago

Why did you do that in the first place? Composer is/was always included in the basic images. The container now tries to symlink composer to either version 1 or 2 during boot.

See https://dockerfile.readthedocs.io/en/latest/content/DockerImages/dockerfiles/php.html#composer and https://github.com/webdevops/Dockerfile/issues/369

leonidd-hyuna commented 3 years ago

got error in case have COPY --from=composer:1.10.16 /usr/bin/composer /usr/local/bin/composer in Dockerfile otherwise if remove this line (there is no composer installation at all) getting /bin/sh: 1: composer: not found

leonidd-hyuna commented 3 years ago

while running with docker-compose COMPOSER_VERSION is set to 1 in multiple places including Dockerfile but there is no composer while running with docker-compose build

worker$ docker-compose build --no-cache
rabbitmq uses an image, skipping
Building app
Step 1/4 : FROM webdevops/php-dev:7.4
 ---> 8c8243c43e82
Step 2/4 : ENV COMPOSER_VERSION=1
 ---> Running in 39fd6843503b
Removing intermediate container 39fd6843503b
 ---> 981df9879e5f
Step 3/4 : RUN echo env-composer-version ${COMPOSER_VERSION}
 ---> Running in a88f71f3c4a4
env-composer-version 1
Removing intermediate container a88f71f3c4a4
 ---> 930eb06ada44
Step 4/4 : RUN composer --version
 ---> Running in ebf62ca99927
/bin/sh: 1: composer: not found
ERROR: Service 'app' failed to build : The command '/bin/sh -c composer --version' returned a non-zero code: 127
htuscher commented 3 years ago

Fixed with https://github.com/webdevops/Dockerfile/commit/40305a2a77c845356cca3ab005cf2ea5abffe927 (build pending, approx 1 hour)