Public Repository

Last pushed: 2 years ago
Short Description
rpi-ipcheck: Docker image for Raspberry Pi
Full Description

rpi-ipcheck Docker image for Raspberry Pi


This Docker image is based on Alpine Linux Hypriot image for Raspberry Pi and embeds only essential packages to run script. is a Python script to register your dynamic IP address using the NIC V2.0 protocol.


17/04/2016: v1.0.0 (First release)



Pull image from Docker Hub

First pull the image from the Docker registry with the following command :

$ docker pull adzero/rpi-ipcheck:latest

Helper script

The entrypoint of the image is a custom helper script rpi-ipcheck that handles necessary operations :

rpi-ipcheck [-h] [-c] [-s [-p h|m] [-v 1-23|1-59]] [-e] [-r]

        -h : display this help
        -c : download default configuration file and save it to '/etc/ipcheck/ipcheck.default.conf'
        -s : schedule execution
        -p : set execution period to hours (h) or minutes (m) (-s option is mandatory to use -p)
             default value is 'h'
        -v : set period value (-s option is mandatory to use -v)
             valid value range is 1-23 (default is 1) for hour period and 1-59 for minute period (default is 5)
        -e : execute with configuration file options
        -r : run the scheduler (schedule should exist or use -s option)

Use in image

To make a container based on this image work properly, you need to use at least the following options :

  • -s to create the crontab schedule
  • -r to run the cron daemon

Create/Run container

Once image has been pulled, create or run your container with either the create or the run command.

To access configuration file, a Docker host directory (/host/configuration/dir) must be mounted as the container configuration directory (/etc/ipcheck).

Create example :

$ docker create -v /host/configuration/dir:/etc/ipcheck --name my-container adzero/rpi-ipcheck:latest -s -r 

Run example :

$ docker run -v /host/configuration/dir:/etc/ipcheck --name my-container adzero/rpi-ipcheck:latest -s -r 

Logs and output files

-v /host/logs/dir:/var/ipcheck can be used to store logs and output files outside of the container. /host/logs/dir is the path on the Docker host where these files will be written.

Restart after failure

To ensure the container restarts after a failure, you can use the --restart option of the create or the run command :

$ docker create -t -v /host/configuration/dir:/etc/ipcheck --restart:unless-stopped --name my-container adzero/rpi-ipcheck:latest

Container start

Once your container is created, you can start it and check the logs :

$ docker start my-container
$ docker logs -f my-container

If your configuration file exists (use -c helper script option to download default configuration file) and is valid you should see something as :

RPI-IPCHECK (2016-04-17 18:37:15)
RPI-IPCHECK: Setting rpi-ipcheck crontab entry.
RPI-IPCHECK: Configuration file found at '/etc/ipcheck/ipcheck.conf'.
RPI-IPCHECK: Invoking for the first time
ipcheck/0.251 Sun Apr 10 21:30:01 2016 opt_directory set to /var/ipcheck/ opt_https_only set to '1' opt_custom set opt_makedat set opt_username = user opt_password = ************ opt_hostnames = PWD = /root Datfile = /var/ipcheck/ipcheck.dat Errfile = /var/ipcheck/ipcheck.err Waitfile = /var/ipcheck/ipcheck.wait Htmlfile = /var/ipcheck/ipcheck.html Tempfile = /var/ipcheck/ipcheck.tmp web based ip detection for localip Trying URL webip.out file created webip detected = XXX.XXX.XXX.XXX DNS lookups to create data file. Good, no ipcheck.dat file found. ip1 looking up result: ''['']['XXX.XXX.XXX.XXX'] ip1 = XXX.XXX.XXX.XXX Writing the new dat file. Good, filehosts and hostnames are the same. Good, no ipcheck.err file. Good, no ipcheck.wait file. Checking hosts in file vs command line. The database matches local address.  No hosts update.

Otherwise, follow instructions in logs to fix any problem.

Docker Pull Command