Switched to parameter-less build and environment-controlled run script
This commit is contained in:
parent
e6e0d3fd29
commit
509a354c9b
2 changed files with 24 additions and 16 deletions
26
Dockerfile
26
Dockerfile
|
@ -1,23 +1,17 @@
|
||||||
from debian:stretch
|
from debian
|
||||||
|
|
||||||
ARG SERVER_NAME=urbackup-server
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wget
|
||||||
ARG CLIENT_NAME=urbackup-client
|
|
||||||
ARG CLIENT_KEY=secret_key
|
|
||||||
|
|
||||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y mktemp wget
|
|
||||||
|
|
||||||
RUN TF=`mktemp` &&\
|
RUN TF=`mktemp` &&\
|
||||||
wget "https://hndl.urbackup.org/Client/latest/update/UrBackupUpdateLinux.sh" -O $TF &&\
|
wget "https://hndl.urbackup.org/Client/latest/update/UrBackupUpdateLinux.sh" -O $TF &&\
|
||||||
sh $TF &&\
|
sh $TF silent &&\
|
||||||
rm $TF &&\
|
rm $TF
|
||||||
urbackupclientctl wait-for-backend &&\
|
|
||||||
urbackupclientctl set-settings -k internet_mode_enabled -v true -k internet_server -v ${SERVER_NAME} -k internet_server_port -v 55415 -k computername -v "${CLIENT_NAME}" -k internet_authkey -v ${CLIENT_KEY} &&\
|
|
||||||
urbackupclientctl add-backupdir --path /backup
|
|
||||||
|
|
||||||
RUN ( [ ! -e /etc/default/urbackupclient ] || sed -i 's/INTERNET_ONLY=false/INTERNET_ONLY=true/' /etc/default/urbackupclient ) &&\
|
|
||||||
( [ ! -e /etc/default/urbackupclient ] || sed -i 's/LOGLEVEL=warn/LOGLEVEL=info/' /etc/default/urbackupclient ) &&\
|
|
||||||
( [ ! -e /etc/default/urbackupclient ] || sed -i 's/RESTORE=disabled/RESTORE=server-confirms/' /etc/default/urbackupclient )
|
|
||||||
|
|
||||||
EXPOSE 35621/TCP 35622/UDP 35623/TCP
|
EXPOSE 35621/TCP 35622/UDP 35623/TCP
|
||||||
|
|
||||||
CMD ["urbackupclientbackend", "--config", "/etc/default/urbackupclient"]
|
HEALTHCHECK CMD urbackupclientbackend status
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY run.sh /app
|
||||||
|
|
||||||
|
CMD ["sh", "run.sh"]
|
||||||
|
|
14
run.sh
Normal file
14
run.sh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
urbackupclientbackend --loglevel info --restore server-confirms --internet-only &
|
||||||
|
urbackupclientctl wait-for-backend
|
||||||
|
|
||||||
|
urbackupclientctl set-settings -k internet_mode_enabled -v true
|
||||||
|
urbackupclientctl set-settings -k internet_server -v $SERVER_NAME
|
||||||
|
urbackupclientctl set-settings -k internet_server_port -v 55415
|
||||||
|
urbackupclientctl set-settings -k computername -v $CLIENT_NAME
|
||||||
|
urbackupclientctl set-settings -k internet_authkey -v $CLIENT_KEY
|
||||||
|
|
||||||
|
urbackupclientctl add-backupdir --path /backup
|
||||||
|
|
||||||
|
sleep infinity
|
Loading…
Reference in a new issue