failed to install composer packages in docker container

padhie :

Since a few days i cant install composer-packages anymore in my local docker container. I create new composer.json with composer init and try to add a package with composer require fzaninotto/faker
Always i get the same error message

# composer require fzaninotto/faker
Using version ^1.9 for fzaninotto/faker
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
    Failed to download fzaninotto/faker from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php --ini` to show them.
    Now trying to download from source
  - Installing fzaninotto/faker (v1.9.1): Cloning fc10d778e4 from cache
    fc10d778e4b84d5bd315dad194661e091d307c6f is gone (history was rewritten?)

Installation failed, reverting ./composer.json to its original content.


  [RuntimeException]
  Failed to execute git checkout 'fc10d778e4b84d5bd315dad194661e091d307c6f' -- && git reset --hard 'fc10d778e4b84d5bd315dad194661e091d307c6f' --

  fatal: failed to read object fc10d778e4b84d5bd315dad194661e091d307c6f: Operation not permitted


require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

First i guess my ssh key is the problem but i create a new one and add this to github with the same error.
Than i try it with composer clear and the problem don't resolved.

The problem come in EACH docker container and EACH composer packages... so i cant be a problem with single packages or container.

Have anyone an idea that i can do to use composer again?

Ludo :

If you're using Docker Desktop (Windows) and you updated to the latest version 2.2.0.4, then you get this issue.

Downgrade to the 2.2.0.3 and it should work again (at least it did for me). See: https://forums.docker.com/t/issues-after-upgrading-docker-desktop-to-2-2-0-4/90589

To downgrade:

  • Uninstall Docker Desktop. Attention: it will delete your containers, save them before if you want to import them back
  • Go this page: https://docs.docker.com/docker-for-windows/release-notes/
  • Click Download under 2.2.0.3
  • Install Docker Desktop with the installer file
  • When started it will ask to upgrade to 2.2.0.4, just say "Skip this build"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=346583&siteId=1