Get error when using letsencrypt on docker

I’m using docker + nginx. When using letsencrypt I get an error like in the appendix.
What is the easiest way to use letesncrypt?

Dockerfile
## Stage 1
FROM node:latest as react-build
WORKDIR /code
#COPY . ./
COPY . /code/
RUN yarn
RUN yarn build

#Stage 2
FROM nginx:1.15-alpine
RUN apk add inotify-tools certbot openssl ca-certificates
WORKDIR /opt
COPY entrypoint.sh nginx-letsencrypt
COPY certbot.sh certbot.sh
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=react-build /code/build /usr/share/nginx/html
COPY ssl-options/ /etc/ssl-options
RUN chmod +x nginx-letsencrypt && \
    chmod +x certbot.sh 
ENTRYPOINT ["./nginx-letsencrypt"]
#CMD ["nginx", "-g", "nodemon", "--exec", "npm", "run", "docker-start", "daemon off;"]
# docker run -e DOMAIN=dentistdoctor.net -e EMAIL=mymailaddress@homail.com -p 80:80 -p 443:443 -d hastatakip-frontend

My domain is: dentistdoctor.net

I ran this command: docker run -e DOMAIN=dentistdoctor.net -e EMAIL=mymailaddres@hotmail.com -d --name frontend -p 80:80 -p 443:443 frontend

It produced this output:
Attaching to frontend_hastatakip-frontend_1, frontend_nginx_1
hastatakip-frontend_1 | Generating RSA private key, 4096 bit long modulus (2 primes)
hastatakip-frontend_1 | …++++
hastatakip-frontend_1 | …++++
hastatakip-frontend_1 | e is 65537 (0x010001)
hastatakip-frontend_1 | ./nginx-letsencrypt: line 13: sl: not found
hastatakip-frontend_1 | req: Skipping unknown attribute “EMAIL”
hastatakip-frontend_1 | Signature ok
hastatakip-frontend_1 | subject=C = PT, ST = World, L = World, O = dentistdoctor.net, OU = Dentistdoctor, CN = dentistdoctor.net
hastatakip-frontend_1 | Getting Private key
hastatakip-frontend_1 | Setting up watches.
hastatakip-frontend_1 | Watches established.
hastatakip-frontend_1 | Requested domain is not a FQDN because it contains an empty label.

Hi @turkdoktoru

there

-d --name 

is a -d without an argument. -d - then a valid domain name must follow. Your argument is empty -->> remove that -d.

That's your error

hastatakip-frontend_1 | Requested domain is not a FQDN because it contains an empty label.

edit the runtime code and build it again. But the output is as follows

Error creating new order :: too many certificates already issued for exact set of domains: dentistdoctor.net: see https://letsencrypt.org/docs/rate-limits/
2019-11-13 14:16:18,499:ERROR:certbot.log:An unexpected error occurred:
2019-11-13 14:16:18,500:ERROR:certbot.log:There were too many requests of a given type :: Error creating new order :: too many certificates already issued for exact set of domains: dentistdoctor.net: see https://letsencrypt.org/docs/rate-limits/

Please read the link in the error message.

You have created too much certificates - https://check-your-website.server-daten.de/?q=dentistdoctor.net#ct-logs

Issuer not before not after Domain names LE-Duplicate next LE
Let's Encrypt Authority X3 2019-11-06 2020-02-04 dentistdoctor.net - 1 entries duplicate nr. 4
Let's Encrypt Authority X3 2019-11-06 2020-02-04 dentistdoctor.net - 1 entries duplicate nr. 3
Let's Encrypt Authority X3 2019-11-06 2020-02-04 dentistdoctor.net - 1 entries duplicate nr. 2
Let's Encrypt Authority X3 2019-11-06 2020-02-04 dentistdoctor.net - 1 entries duplicate nr. 1
Let's Encrypt Authority X3 2019-11-06 2020-02-04 dentistdoctor.net - 1 entries
Let's Encrypt Authority X3 2019-11-05 2020-02-03 dentistdoctor.net, www.dentistdoctor.net - 2 entries

Looks like you have created 5 identical with 2019-11-06, so that blocks. Wait some hours.

And don't create more then one certificate. Do you save the certificate outside of your docker so you can re-use the certificate? If not, that's wrong.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.