DockerでPHPの環境作っていたらエラーに遭遇
Using version ^3.1 for laravel/installer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 16 installs, 0 updates, 0 removals
- Installing symfony/process (v5.0.8): Downloading (failed)
Downloading (failed)
Downloading (failed) Failed to download symfony/process from dist: The "https://api.github.com/repos/symfony/process/zipball/3179f68dff5bad14d38c4114a1dab98030801fd7" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Now trying to download from source
- Installing symfony/process (v5.0.8): Cloning 3179f68dff
Installation failed, deleting ./composer.json.
[RuntimeException]
Failed to clone https://github.com/symfony/process.git via https, ssh protocols, aborting.
- https://github.com/symfony/process.git
Cloning into '/composer/vendor/symfony/process'...
fatal: unable to access 'https://github.com/symfony/process.git/': server certificate verification failed. CAfile: none CRLfile: none
どうやら、以下でソースをgitからcloneしてくる処理でコケたらしい。
composer global require "laravel/installer"
対策
DockerfileのRUNコマンドにexport GIT_SSL_NO_VERIFY=1
を追記
RUN export GIT_SSL_NO_VERIFY=1 \
&& composer global require "laravel/installer"
ちなみにexport
コマンドはターミナルからログアウトもしくはexitするまで保持される。