edbizarro / gitlab-ci-pipeline-php

:coffee: Docker images for test PHP applications with Gitlab CI (or any other CI platform!)
https://hub.docker.com/r/edbizarro/gitlab-ci-pipeline-php
MIT License
528 stars 166 forks source link

Image gitlab-ci-pipeline-php can't find composer cli #88

Closed ahmed-bhs closed 3 years ago

ahmed-bhs commented 4 years ago

I Have this gilab-ci.yml:

build:
    image: edbizarro/gitlab-ci-pipeline-php:7.3-alpine
    script:
        - composer install --prefer-dist --no-ansi --no-interaction --no-progress
        - sudo apk add --no-cache zip unzip

And I'm facing this error:

Skipping Git submodules setup
$ composer install --prefer-dist --no-ansi --no-interaction --no-progress
bash: line 90: composer: command not found
ERROR: Job failed: exit status 1_
INOVAdev-joost commented 4 years ago

In our project we have moved the composer dependency to a separate docker composer container. By executing this command you fire up a docker container for installing composer dependencies:

docker run --user 1000:1000 --rm -v $(HOME)/.composer/auth.json:/tmp/auth.json -vpwd:/app composer:1.8 require <packagename>

Instead of require <packagename> you could also execute install or update commands. Carefull, you should edit the options to your own need.

edbizarro commented 4 years ago

It's weird, I use this command daily without problems, are u still having this problem?