3
1

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 build時にDNSの名前解決が失敗する問題の対処

Last updated at Posted at 2020-08-19

環境

Host: macOS Mojave 10.14.6, docker desktop 2.3.0.4
Base image: alpine:3.12

問題と原因

Docker imageをbuildする際に、peclのライブラリをインストールしようとして以下のエラーが発生。

No releases available for package "pecl.php.net/zip"
install failed

諸々調べているとdockerコンテナ内部からpecl.php.netに到達出来ていないのが原因だった。

解決方法

Docker EngineにGoogle Public DNSを指定することで解決した。
Docker desktop > Preference > Docker Engine

{
  //省略
  "dns" : [ "8.8.8.8" ]
}
3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?