A Docker image to monitor the public IP address. Mirrored from GitHub https://github.com/outlyer-net/docker-public-ip-monitor
Go to file
Toni Corvera 47149e2da3 Add configurable actions 2022-12-09 18:58:30 +01:00
imgroot Add configurable actions 2022-12-09 18:58:30 +01:00
.dockerignore Initial import 2020-03-17 12:50:46 +01:00
.gitignore Initial import 2020-03-17 12:50:46 +01:00
Dockerfile Fix typo 2020-03-17 13:52:44 +01:00
GNUmakefile Added rule to push readme to Docker Hub 2020-03-17 13:28:01 +01:00
LICENSE Initial commit 2020-03-17 11:49:59 +01:00
README.md Note about the experimental status of this image 2020-03-19 06:56:30 +01:00
crontab.example Actual example 2020-03-17 13:32:32 +01:00

README.md

docker-public-ip-monitor

Keep a record of your public IP address over time.
This is a multiarch image, with 32 and 64 bit support on PC and ARM.
NOTE I'm still experimenting with the format of the log, using this image at this time can lead to unexpected changes in behaviour between updates.

Image Size

Information

Set up

This image contains a script to check your public ip and provides a barebones view of the recorded IPs over time.
The image will not check the IP periodically on its own, to do that you'll have to use something like a crontab, e.g.:

  1. Deploy the image
    $ docker run public_ip:/data --name public-ip-monitor outlyernet/public-ip-monitor

  2. Add a crontab entry to update the recorded IP, e.g. every 15 minutes:
    $ crontab -e
    ...
    */15 * * * * docker exec public-ip-monitor /update
    ...

Services

The image contains a short list of known stable servers that will return your IP address (and nothing else) when accessed over HTTPS in the file services.txt, one per line. And you can add your own. If you know of any other well stablished server let me know.

By default the updater script will pick a random server out of the list on each update, though you can force it to pick a specfic one through the USE_SERVICE environment variable (see below).

Environment variables

You can modify the behaviour of the update script with a couple environment variables:

  • USE_SERVICE: Set to 0 to pick a random entry from services.txt, or to any other number to use the server corresponding to such line (i.e. 1 picks icanhazip.com)
  • UPDATE_TIMEOUT: Timeout in seconds to retrieve the IP (accepts decimals)

LGPL 3.0+ License

See the LICENSE file for the complete text of the GNU Lesser General Public License.

Excerpt:

This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.