docker-images-php icon indicating copy to clipboard operation
docker-images-php copied to clipboard

GItlab ci: Composer cache permission denied

Open rophini92 opened this issue 1 year ago • 1 comments

Hi,

We have an issue with using the image using Gitlab-ci. We're migrating from the edbizarro/gitlab-ci-pipeline-php image.

Expected Behavior

Composer install should install all the packages. It works if we add the --no-cache flag to composer install.

Current Behavior

Composer fails installing, gives the following error while downloading the packages:

Failed to download nunomaduro/collision from dist: /cache/files/nunomaduro/collision does not exist and could not be created: 
    Now trying to download from source
  - Syncing nunomaduro/collision (v8.1.1) into cache
In Cache.php line 201:
  copy(/cache/files/symfony/polyfill-intl-grapheme/f2ff520717c3b4b0b6f235bd92  
  376b0e57d129tyc.zip): Failed to open stream: Permission denied   

Your Environment

These are the settings in our gitlab-ci file.

build:composer:
  image: thecodingmachine/php:8.2-v4-cli
  stage: build
  only:
    - master
    - main
    - development
    - dev
  script:
    - composer install

Thanks!

rophini92 avatar Apr 11 '24 10:04 rophini92

I do not understand why composer in your environment store his cache to /cache/ instead of /home/docker/.cache/composer . I do not reproduice it with a regular docker run process. I recommand you to check your environments variables and gitlab-ci runner configuration.

mistraloz avatar Apr 15 '24 10:04 mistraloz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.

stale[bot] avatar Jun 14 '24 14:06 stale[bot]

This issue has been automatically closed because it has not had recent activity. Please, reopen if you need.

stale[bot] avatar Jun 22 '24 03:06 stale[bot]