From 30743bde9b4e1d48dc2da755f82a6f0490bf001d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 23 Jul 2017 12:53:34 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a85290..d08fc39 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # adferrand/backuppc -![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.1.3-4.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.1.3-4.svg)](https://microbadger.com/images/adferrand/backuppc:4.1.3-4) +![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.1.3-5.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.1.3-5.svg)](https://microbadger.com/images/adferrand/backuppc:4.1.3-5)   ![](https://img.shields.io/badge/tags-3-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:3.3.2.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:3.3.2.svg)](https://microbadger.com/images/adferrand/backuppc:3.3.2) * [Introduction](#introduction) From d6924d1f5a80f78fa8c1c8b43305d5c39e455480 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 23 Jul 2017 13:12:33 +0200 Subject: [PATCH 2/5] Update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d1dc518..6bc15c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.3-4 \ No newline at end of file +4.1.3-5 From 17aa3d5b314aac1fd655e9b85060829272e72d63 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 2 Aug 2017 10:15:42 +0200 Subject: [PATCH 3/5] Add env variable driven timezone --- Dockerfile | 2 +- README.md | 30 +++++++++++++++++++++++++++++- VERSION | 2 +- files/entrypoint.sh | 5 +++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c4dd59b..b6ee221 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN apk --no-cache add \ # Install backuppc build dependencies gcc g++ autoconf automake make git patch perl perl-dev perl-cgi expat expat-dev curl wget \ # Install backuppc runtime dependencies -supervisor rsync samba-client iputils openssh openssl rrdtool msmtp lighttpd lighttpd-mod_auth gzip apache2-utils \ +supervisor rsync samba-client iputils openssh openssl rrdtool msmtp lighttpd lighttpd-mod_auth gzip apache2-utils tzdata \ # Compile and install needed perl modules && cpan App::cpanminus \ && cpanm -n Archive::Zip XML::RSS File::Listing \ diff --git a/README.md b/README.md index d08fc39..417ee8a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ * [Advanced SMTP configuration](#advanced-smtp-configuration) * [Upgrading](#upgrading) * [Dockerising an existing BackupPC v3.x](#dockerising-an-existing-backuppc-v3x) -* [Shell access](#shell-access) +* [Miscellaneous](#miscellaneous) + * [Timezone](#timezone) + * [Shell access](#shell-access) ## Introduction @@ -222,6 +224,32 @@ docker run \ The configure.pl script will detect a v3.x version under /etc/backuppc, and will run appropriate upgrade operations (in particular enabling legacy v3.x pool to access it from a BackupPC v4.x). +## Miscellaneous + +### Timezone + +By default the timezone of this docker is set to UTC. To modify it, you can specify a tzdata-compatible timezone in the environment variable `TZ`. + +```bash +# For Paris time (including daylight) +docker run \ + --name backuppc \ + --publish 80:8080 \ + --env TZ=Europe/Paris \ + adferrand/backuppc +``` + +Alternatively, you can sync the container timezone to its host by mounting the host file `/etc/localtime` to the container path `/etc/localtime`. + +```bash +# For Paris time (including daylight) +docker run \ + --name backuppc \ + --publish 80:8080 \ + --mount /etc/localtime:/etc/localtime:ro \ + adferrand/backuppc +``` + ## Shell access For debugging and maintenance purpose, you may need to start a shell in your running container. With a Docker of version 1.3.0 or higher, you can do: diff --git a/VERSION b/VERSION index 6bc15c4..d8c3741 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.3-5 +4.1.3-6 diff --git a/files/entrypoint.sh b/files/entrypoint.sh index 7f314cf..6f813ad 100755 --- a/files/entrypoint.sh +++ b/files/entrypoint.sh @@ -5,6 +5,11 @@ if [ -f /firstrun ]; then echo 'First run of the container. BackupPC will be installed.' echo 'If exist, configuration and data will be reused and upgraded as needed.' + # Configure timezone if needed + if [ -z "$TZ" ]; then + cp /usr/share/zoneinfo/$TZ /etc/localtime + fi + # Create backuppc user addgroup -S -g ${BACKUPPC_GUID:-1000} backuppc adduser -D -S -h /home/backuppc -G backuppc -u ${BACKUPPC_UUID:-1000} backuppc From 32dc56e340a20b35a12fdcd1d529417c046d52ef Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 2 Aug 2017 10:17:36 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 417ee8a..280f652 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # adferrand/backuppc -![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.1.3-5.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.1.3-5.svg)](https://microbadger.com/images/adferrand/backuppc:4.1.3-5)   +![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.1.3-6.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.1.3-6.svg)](https://microbadger.com/images/adferrand/backuppc:4.1.3-6)   ![](https://img.shields.io/badge/tags-3-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:3.3.2.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:3.3.2.svg)](https://microbadger.com/images/adferrand/backuppc:3.3.2) * [Introduction](#introduction) @@ -242,7 +242,6 @@ docker run \ Alternatively, you can sync the container timezone to its host by mounting the host file `/etc/localtime` to the container path `/etc/localtime`. ```bash -# For Paris time (including daylight) docker run \ --name backuppc \ --publish 80:8080 \ From 5a599227ea578578165ca0febf3ecca397d129ee Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 2 Aug 2017 10:21:33 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 280f652..beea6ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # adferrand/backuppc -![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.1.3-6.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.1.3-6.svg)](https://microbadger.com/images/adferrand/backuppc:4.1.3-6)   +![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.1.3-6.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.1.3-6.svg)](https://microbadger.com/images/adferrand/backuppc:4.1.3-6)
![](https://img.shields.io/badge/tags-3-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:3.3.2.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:3.3.2.svg)](https://microbadger.com/images/adferrand/backuppc:3.3.2) * [Introduction](#introduction)