Skip to content

Commit 538fcf3

Browse files
committed
Initial commit
0 parents  commit 538fcf3

File tree

7 files changed

+114
-0
lines changed

7 files changed

+114
-0
lines changed

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM lsiobase/alpine
2+
MAINTAINER aptalca
3+
4+
# environment settings
5+
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
6+
7+
# install packages
8+
RUN \
9+
apk add --no-cache \
10+
curl
11+
12+
# add local files
13+
COPY root/ /

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png)
2+
3+
## This is a Container in active development by the [LinuxServer.io](https://linuxserver.io) team and is not recommended for use by the general public.
4+
5+
If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general, check out the following.
6+
7+
* [forum.linuxserver.io](https://forum.linuxserver.io)
8+
* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`
9+
* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation!

READMETEMPLATE.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png)
2+
3+
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring auto-update on startup, easy user mapping and community support. Find us for support at:
4+
* [forum.linuxserver.io](https://forum.linuxserver.io)
5+
* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`
6+
* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation!
7+
8+
# linuxserver/duckdns
9+
10+
Duck DNS is a free service which will point a DNS (sub domains of duckdns.org) to an IP of your choice. The service is completely free, and doesn't require reactivation or forum posts to maintain its existence.
11+
12+
## Usage
13+
14+
```
15+
docker create \
16+
--name=DuckDNS \
17+
-e PGID=<gid> -e PUID=<uid> \
18+
-e SUBDOMAINS=<subdomains> \
19+
-e TOKEN=<token> \
20+
linuxserver/duckdns
21+
```
22+
23+
**Parameters**
24+
25+
* `-e PGID` for GroupID - see below for explanation
26+
* `-e PUID` for UserID - see below for explanation
27+
* `-e SUBDOMAINS` for subdomains - multiple subdomains allowed, comma separated, no spaces
28+
* `-e TOKEN` for DuckDNS token
29+
30+
31+
### User / Group Identifiers
32+
33+
Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™.
34+
35+
In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below:
36+
37+
```
38+
$ id <dockeruser>
39+
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
40+
```
41+
42+
## Setting up the application
43+
44+
First, go to www.duckdns.org, register your subdomain and retrieve your token
45+
Then run the docker create command above with your subdomain(s) and token
46+
It will update your IP with the DuckDNS service every 5 minutes
47+
48+
49+
## Updates
50+
51+
* Shell access whilst the container is running: `docker exec -it DuckDNS /bin/bash`
52+
* Upgrade to the latest version: `docker restart DuckDNS`
53+
* To monitor the logs of the container in realtime: `docker logs -f DuckDNS`
54+
55+
## Versions
56+
57+
+ **25.03.2016:** Initial release

root/app/duck.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
. /app/duck.conf
4+
RESPONSE=`curl -s "https://www.duckdns.org/update?domains=$SUBDOMAINS&token=$TOKEN&ip="`
5+
if [ "$RESPONSE" = "OK" ]; then
6+
echo "Your IP was updated at "$(date)
7+
else
8+
echo "Something went wrong, please check your settings "$(date)
9+
fi

root/defaults/duckcron

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*/5 * * * * /app/duck.sh 2>&1

root/etc/cont-init.d/40_config.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
#Check to make sure the subdomain and token are set
4+
if [ -z "$SUBDOMAINS" ] || [ -z "$TOKEN" ]; then
5+
echo "Please pass both your subdomain(s) and token as environment variables in your docker run command. See docker info for more details."
6+
exit 1
7+
else
8+
echo "Retrieving subdomain and token from the environment variables"
9+
echo -e "SUBDOMAINS=$SUBDOMAINS TOKEN=$TOKEN" > /app/duck.conf
10+
fi
11+
12+
# set crontab
13+
crontab -u abc /defaults/duckcron
14+
15+
# permissions
16+
chown -R abc:abc \
17+
/app
18+
chmod +x /app/duck.sh
19+
20+
# run initial IP update
21+
exec \
22+
s6-setuidgid abc /app/duck.sh

root/etc/services.d/cron/run

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
/usr/sbin/crond -f -S -l 0 -c /etc/crontabs

0 commit comments

Comments
 (0)