Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ma0c/ccde47b8e92bc42d0f7aaec48f455a33 to your computer and use it in GitHub Desktop.
Save ma0c/ccde47b8e92bc42d0f7aaec48f455a33 to your computer and use it in GitHub Desktop.

Revisions

  1. @PieterScheffers PieterScheffers revised this gist Jun 19, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion start_docker_registry.bash
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    # Generate SSL certificate for domain
    /opt/letsencrypt/letsencrypt-auto certonly --keep-until-expiring --standalone -d domain.example.com --email [email protected]

    # Renew letsencrypt certificates
    # Setup letsencrypt certificates renewing
    line="30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/letsencrypt-renew.log"
    (crontab -u root -l; echo "$line" ) | crontab -u root -

  2. @PieterScheffers PieterScheffers revised this gist Jun 19, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion start_docker_registry.bash
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@
    /opt/letsencrypt/letsencrypt-auto certonly --keep-until-expiring --standalone -d domain.example.com --email [email protected]

    # Renew letsencrypt certificates
    line="30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log"
    line="30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/letsencrypt-renew.log"
    (crontab -u root -l; echo "$line" ) | crontab -u root -

    # Rename SSL certificates
  3. @PieterScheffers PieterScheffers revised this gist Jun 19, 2016. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions start_docker_registry.bash
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,13 @@
    # install letsencrypt
    # https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

    # Generate SSL certificate for domain
    /opt/letsencrypt/letsencrypt-auto certonly --keep-until-expiring --standalone -d domain.example.com --email [email protected]

    # Renew letsencrypt certificates
    line="30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log"
    (crontab -u root -l; echo "$line" ) | crontab -u root -

    # Rename SSL certificates
    # https://community.letsencrypt.org/t/how-to-get-crt-and-key-files-from-i-just-have-pem-files/7348
    cd /etc/letsencrypt/live/domain.example.com/
  4. @PieterScheffers PieterScheffers revised this gist Jun 19, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion start_docker_registry.bash
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,7 @@ docker run -d -p 5000:5000 --restart=always --name registry \
    -v /opt/docker-registry:/var/lib/registry \
    -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
    -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
    registry:2
    registry:2

    # List images
    # https://domain.example.com/v2/_catalog
  5. @PieterScheffers PieterScheffers revised this gist Jun 19, 2016. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions start_docker_registry.bash
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    #!/usr/bin/env bash

    # install docker
    # https://docs.docker.com/engine/installation/linux/ubuntulinux/

    # install docker-compose
    # https://docs.docker.com/compose/install/

    # install letsencrypt
    # https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

  6. @PieterScheffers PieterScheffers created this gist Jun 19, 2016.
    20 changes: 20 additions & 0 deletions start_docker_registry.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/usr/bin/env bash

    # install letsencrypt
    # https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

    # Rename SSL certificates
    # https://community.letsencrypt.org/t/how-to-get-crt-and-key-files-from-i-just-have-pem-files/7348
    cd /etc/letsencrypt/live/domain.example.com/
    cp privkey.pem domain.key
    cat cert.pem chain.pem > domain.crt
    chmod 777 domain.crt
    chmod 777 domain.key

    # https://docs.docker.com/registry/deploying/
    docker run -d -p 5000:5000 --restart=always --name registry \
    -v /etc/letsencrypt/live/domain.example.com:/certs \
    -v /opt/docker-registry:/var/lib/registry \
    -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
    -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
    registry:2