4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dockerビルドで git cloneで証明書エラーが発生するときの対応

Posted at

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するまで保持される。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?