7
5

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.

x509: certificate signed by unknown authority の対応

Last updated at Posted at 2020-01-03

目的

Dockerfileにgo getしようとすると、↓このようなエラーが発生してたので、解決法をメモ
x509: certificate signed by unknown authority

調べた結果、
go getnpmはSSLを経由して実行しています。なので、証明書をdockerに食わせないといけない。

解決方法

OSのcafile.pemDockerfileにコピーします

COPY cafile.pem /usr/local/share/ca-certificates/
RUN apk add --no-cache ca-certificates && \ 
    update-ca-certificates

hoge.pemはオレオレ証明書生成できると思う
参考:
http://rikuga.me/2017/12/24/oreore-ca-and-ssl-cert/
https://qiita.com/ll_kuma_ll/items/13c962a6a74874af39c6

コード

一応簡単なgitコードはこちらになります。

7
5
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
7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?