Skip to content

Instantly share code, notes, and snippets.

@ryanjohnston
Created September 9, 2018 18:45
Show Gist options
  • Save ryanjohnston/3c82930809af47d26a46f812470847d9 to your computer and use it in GitHub Desktop.
Save ryanjohnston/3c82930809af47d26a46f812470847d9 to your computer and use it in GitHub Desktop.
[Docker - Servers] Collection of scripts used to launch Docker server resources
#!/usr/bin/env bash
#
# Free dynamic DNS service
#
# Requires the following global values to be defined elsewhere:
#
# DUCKDNS_TOKEN - Get this from your account page at DuckDNS.
# PGID - Your users GID
# PUID - Your users UID
# SUBDOMAINS - Get this from your account page at DuckDNS.
# TZ - Your timezone (ex. "America/Edmonton")
#
# Create container
#
duckdns_create() {
docker create \
--name=duckdns \
-e "PGID=$PGID" \
-e "PUID=$PUID" \
-e "SUBDOMAINS=$SUBDOMAINS" \
-e "TOKEN=$DUCKDNS_TOKEN" \
-e "TZ=$TZ" \
linuxserver/duckdns
}
#
# Run container
#
duckdns() {
docker start duckdns
}
#
# View logs
#
duckdns_logs() {
docker logs -f duckdns
}
#
# Save container locally
#
duckdns_save() {
docker commit \
--author "$AUTHOR" \
duckdns \
ryanjohnston/duckdns:latest
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment