Skip to content

Instantly share code, notes, and snippets.

@ziozzang
Created May 5, 2018 06:29
Show Gist options
  • Save ziozzang/0660c94c5f80a44579fb99d49d312db7 to your computer and use it in GitHub Desktop.
Save ziozzang/0660c94c5f80a44579fb99d49d312db7 to your computer and use it in GitHub Desktop.
This docs show how to issuing wildcard cert(by Let's Encrypt) with docker.
EMAIL="foo@barcom"
DOMAINS="example.com"
###################################################################
# Renewing
docker run \
-it --rm \
-v /opt/letsencrypt/:/etc/letsencrypt/ \
-v /opt/letsencrypt/logs/:/var/log/letsencrypt/ \
certbot/certbot \
renew
exit 0
###################################################################
# 1st issuing
docker run \
-it --rm \
-v /opt/letsencrypt/:/etc/letsencrypt/ \
-v /opt/letsencrypt/logs/:/var/log/letsencrypt/ \
certbot/certbot \
--manual \
--agree-tos \
--email "${EMAIL}" \
--preferred-challenges dns-01 \
-d ${DOMAINS} -d *.${DOMAINS} \
--server https://acme-v02.api.letsencrypt.org/directory \
certonly

if such message shown, add TXT recoard twice.

-------------------------------------------------------------------------------
Please deploy a DNS TXT record under the name
_acme-challenge.example.com with the following value:

asdf-asdf-asdf

Before continuing, verify the record is deployed.
-------------------------------------------------------------------------------
Press Enter to Continue

-------------------------------------------------------------------------------
Please deploy a DNS TXT record under the name
_acme-challenge.example.com with the following value:

qqqq-qqqq-qqqq

Before continuing, verify the record is deployed.
-------------------------------------------------------------------------------
  • shown as below
C:\Users\ziozzang>nslookup -q=TXT _acme-challenge.example.com 8.8.8.8
Server:    google-public-dns-a.google.com
Address:  8.8.8.8

Response:
_acme-challenge.example.com        text =

        "asdf-asdf-asdf"
_acme-challenge.jioh.net        text =

        "qqqq-qqqq-qqqq"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment