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 5 years have passed since last update.

Certbotで取得したfullchain.pemとprivkey.pemをDocker内から使う場合はマウントする範囲を気を付ける

Posted at

Certbotで取得したfullchain.pemとprivkey.pemをDockerコンテナ内から使う場合はマウントする範囲を気を付ける

/etc/letsencrypt/live/{ドメイン名}/fullchain.pem
/etc/letsencrypt/live/{ドメイン名}/privkey.pemをそれぞれマウントしたら、
No such file or directoryを食らって解決に少し時間がかかってしまったので、
備忘も兼ねて。

TL;DR

  • /etc/letsencrypt/ごとマウントするのが正しい

理由

/etc/letsencrypt/live/ の中身はシンボリックリンク。
実ファイルは/etc/letsencrypt/archives/以下に格納され、
更新のたびに参照先が変わるようになっている。
よって、/etc/letsencrypt/archives/も持っていく必要がある。

archivesの中身をコピーする手も無きにしも非ずだが、
Let's encryptの証明書は有効期間が短く(30日)頻繁に更新が必要である。
定期的に更新コマンドを叩いてシンボリックリンクと共に更新するのが通常の使い方なので、
/etc/letsencrypt/ごと持って行ってしまったほうが吉。

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?