ClouDNS updater script is able to be run either as generic Python 3 script or as Docker container.
2.7K
ClouDNS updater script is able to be run either as generic Python 3 script or as Docker container.
When this app runs out of a container it uses an .env file to load config. The file format is as follows:
export URL_CDNS = 'https://ipv4.cloudns.net/api/dynamicURL/?q=..........'
export URL_IPIO = 'https://ipinfo.io/json'
export LOG_FILE = 'iplog.txt'
export HOSTNAME = 'put.yourhostname.here'
export SLEEPTIME = 600
Notes:
docker pull ea1het/cloudns-updater In Docker, the way to export variables is to define them on the docker run execution, on a execution line similar to this:
docker run \
-d --restart unless-stopped \
--name cloudns-updater \
-e URL_CDNS="https://ipv4.cloudns.net/api/dynamicURL/?q=.........." \
-e URL_IPIO="https://ipinfo.io/json" \
-e LOG_FILE="iplog.txt" \
-e HOSTNAME="put.yourhostname.here" \
-e SLEEPTIME=600 \
ea1het/cloudns-updater:latest
Note: It can happen that you cannot see logs from the docker container while it's in execution. This is caused due to Python buffered output. In order to see logs from the container buffered output must be disabled for this specific container. This can be done in two ways, a) setting an environment variable or b) using a modifier for the Python interpreter. The prefered option is the first because it doesn't imply modifying the container. In any case, for the sake of the explanation, following are the options explained:
PYTHONUNBUFFERED=0 in the container execution command (in CLI or in a UI like Portainer).python -u app.py inside the container (in development or in run time) or craft the appropiate changes in the Dockerfile:
ENTRYPOINT ["python3"]
CMD ["-u", "app.py"]
docker build \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
--build-arg VERSION=v1.0 \
-t ea1het/cloudns-updater:latest .
Cross-compilation is an experimental Docker feature. You can enable it in your Docker Desktop settings. The procedure to cross-compile can be briefly resumed this way:
docker buildx lsdocker buildx create --name testbuilderdocker buildx use testbuilderdocker buildx inspect --bootstrapdocker logingit clone https://.....docker buildx build \
--platform linux/arm/v7 \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
--build-arg VERSION=v1.0 \
-t ea1het/cloudns-updater:latest-armv7 --push .
docker buildx build \
--platform linux/arm/v6 \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
--build-arg VERSION=v1.0 \
-t ea1het/cloudns-updater:latest-armv6 --push .
docker buildx build \
--platform linux/arm64 \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
--build-arg VERSION=v1.0 \
-t ea1het/cloudns-updater:latest-arm64 --push .
docker buildx build \
--platform linux/amd64 \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
--build-arg VERSION=v1.0 \
-t ea1het/cloudns-updater:latest-amd64 --push .
Content type
Image
Digest
Size
13.4 MB
Last updated
almost 7 years ago
docker pull ea1het/cloudns-updater