Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Provide a Docker Image with Certbot and Azure DNS Plugin Installed

License

Notifications You must be signed in to change notification settings

public-sysunicorns-info/docker-certbot-azure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-certbot-azure

Provide a Docker Image with Certbot and Azure DNS Plugin Installed from https://github.com/terrycain/certbot-dns-azure

Dockerfile usage instructions

A Dockerfile is a script that contains all the instructions needed to build a Docker container image. Below are the steps to build and run a Docker container based on a Dockerfile.

  1. Clone the repository containing the Dockerfile to your local machine.

  2. Change into the directory containing the Dockerfile.

  3. Run the following command to build the Docker image:

    docker build -t certbot-azuredns -f Dockerfile .
  4. Once the image is built, you can run a Docker container based on the image using the following command:

    docker run -it --rm --name certbot-azure-dns \
            -v /etc/letsencrypt/:/etc/letsencrypt/ \
            certbot-azuredns \
            certbot certonly \
            --authenticator dns-azure \
            --preferred-challenges dns \
            --agree-tos \
            --email '[email protected]' \
            --noninteractive \
            --dns-azure-config /etc/letsencrypt/clouddns/azure.ini \
            --domains example.com \
            --domains '*.example.com'
  5. And the contents of the azure.ini is as per the service principal example with 400 permission.

    dns_azure_sp_client_id = AAA...
    dns_azure_sp_client_secret = BBB...
    dns_azure_tenant_id = CCC...
    dns_azure_environment = "AzurePublicCloud"
    dns_azure_zone1 = example.com:/subscriptions/DDD.../resourceGroups/rg-dns001

Docker Compose usage instructions

  1. Clone the repository containing the Dockerfile to your local machine.

  2. Change into the directory containing the Dockerfile.

  3. Using the docker compose file below you can the workload

    version: '3.7'
    services:
    certbot-azure-dns-1:
        build:
        context: .
        dockerfile: Dockerfile
        container_name: certbot-azure-dns-1
        command: 
        - certbot 
        - certonly
        - "[email protected]"
        - "--authenticator=dns-azure"
        - "--preferred-challenges=dns"
        - "--agree-tos"
        - "--noninteractive" 
        - "--dns-azure-config=/secret/azure.ini"
        - "--domains=example.org"
        - "--domains=*.example.org"
        volumes:
        - "./letsencrypt:/etc/letsencrypt"
        - "./secret:/secret:ro"
  4. And the contents of the azure.ini is as per the service principal example with 400 permission in the ./secret local directory.

    dns_azure_sp_client_id = AAA...
    dns_azure_sp_client_secret = BBB...
    dns_azure_tenant_id = CCC...
    dns_azure_environment = "AzurePublicCloud"
    dns_azure_zone1 = example.com:/subscriptions/DDD.../resourceGroups/rg-dns001

About

Provide a Docker Image with Certbot and Azure DNS Plugin Installed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published