Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile.armv7
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM noip-config

MAINTAINER David Coppit <david@coppit.org>

ENV TERM=xterm-256color

RUN true && \
# RunIt stuff
adduser -h /home/user-service -s /bin/sh -D user-service -u 2000 && \
chown user-service:user-service /home/user-service && \
mkdir -p /etc/run_once /etc/service

# Boilerplate startup code
COPY ./boot.sh /sbin/boot.sh
RUN chmod +x /sbin/boot.sh
CMD [ "/sbin/boot.sh" ]

COPY ["config/no-ip2.conf", "/usr/local/etc/"]
30 changes: 30 additions & 0 deletions Dockerfile.armv7.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM hypriot/rpi-alpine
#FROM resin/raspberrypi3-alpine:3.6

MAINTAINER David Coppit <david@coppit.org>

ENV TERM=xterm-256color

RUN true && \
\
echo "http://dl-cdn.alpinelinux.org/alpine/v3.6/community" >> /etc/apk/repositories && \
apk --update upgrade && \
\
# Basics, including runit
apk add bash curl htop runit && \
\
# Needed by our code
apk add expect libc6-compat && \
\
# Alpine Build Tools
apk add alpine-sdk && \
\
rm -rf /var/cache/apk/*

ADD https://www.noip.com/client/linux/noip-duc-linux.tar.gz /files/

RUN set -x && \
chmod a+rwX /files && \
tar -C /files -x -f /files/noip-duc-linux.tar.gz && \
make -C /files/noip-2.1.9-1 && \
cp /files/noip-2.1.9-1/noip2 /usr/local/bin/noip2
33 changes: 33 additions & 0 deletions build_armv7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

DOCKER_NAME=noip
DOCKER_PATH=$(pwd)

docker stop ${DOCKER_NAME}
docker rm ${DOCKER_NAME}
docker rmi ${DOCKER_NAME}

docker build \
-t ${DOCKER_NAME}-config \
-f ${DOCKER_PATH}/Dockerfile.armv7.config \
${DOCKER_PATH}

docker rm noip-config

docker run -i -t \
--name noip-config \
-v ${DOCKER_PATH}/config/:/config \
noip-config bash -c 'make -C /files/noip-2.1.9-1 install; cp /usr/local/etc/no-ip2.conf /config'

docker build \
-t ${DOCKER_NAME} \
-f ${DOCKER_PATH}/Dockerfile.armv7 \
${DOCKER_PATH}

docker rm ${DOCKER_NAME}

docker run -td \
--name=${DOCKER_NAME} \
--restart=unless-stopped \
-v /etc/localtime:/etc/localtime \
${DOCKER_NAME}
14 changes: 12 additions & 2 deletions noip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,24 @@ function ts {
while true
do
echo "$(ts) Launching the noip2 daemon"
/files/noip2-x86_64 -c "$GENERATED_CONFIG_FILE"
if [[ -z $(uname -a | grep "arm") ]]
then
/files/noip2-x86_64 -c "$GENERATED_CONFIG_FILE"
else
/usr/local/bin/noip2
fi

# Give it a few seconds to do the first update. This helps avoid questions about "Last IP Address set 0.0.0.0"
sleep 5

while true
do
output=$(/files/noip2-x86_64 -c "$GENERATED_CONFIG_FILE" -S 2>&1)
if [[ -z $(uname -a | grep "arm") ]]
then
output=$(/files/noip2-x86_64 -c "$GENERATED_CONFIG_FILE" -S 2>&1)
else
output=$(/usr/local/bin/noip2 -S 2>&1)
fi

echo "$(ts) Current status"
echo "$output"
Expand Down