-
Hi @m90, The docker environment I use is Windows based (=Docker Desktop Windows running with WSL). I faced an issue/error with Docker Desktop itself totally unrelated to docker-volume-backup and to get around it, I had to disable its out of the box integration with the default WSL distro (Ubuntu). But by doing so, I got into a little challenge regarding timezone configuration for the backup container (I noticed something was amiss because scheduled backups began running at different times from what I had originally set them to). I found a way to get it working like before but since I am not that much knowledgeable of Linux, I decided to share here what I did mostly for reference. (I saw your statement "As the image is designed to be as small as possible, additional timezone data is not included" in the documentation so I fully understand that it will be unlikely for a fallback method for TZ config to be included in the image itself). The default WSL distro in Windows can have its TZ configured just as usual for a Linux distro, however when I disabled the Docker Desktop integration with it, the docker environment switched to exclusively use a distro named "docker-desktop" (it gets installed by Docker Desktop and is the one used for the containers' runtime environment). This "docker-desktop" distro turns out to be quite minimal, TZ also UTC but no timedatectl installed or any TZ data inside /usr/share/zoneinfo. Mounting /etc/timezone and /etc/localzone from the docker host stopped being a working method to get the desired TZ for the container. To sort it out, without having to fork the repo and tweak the image's dockerfile or modifying the TZ config for the "docker-desktop" distro itself (I got suspicious that any Docker Desktop updates could undo changes I did to it), what I went for was to include this below in my docker compose:
("mycity" used above was just to redact the actual TZ I am using, for privacy) With that in place I set the "TZ" environment variable for the container in the compose file. (container creation/recreation is a tad slower because it first has to download/install tzdata) Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's a great tip. If it suits your setup, you could probably also do this when extending the existing image in a Dockerfile sth like FROM offen/docker-volume-backup:v2
RUN apk update && \
apk add --nocache tzdata && \
cp /usr/share/zoneinfo/America/mycity /etc/localtime && \
echo 'America/mycity' > /etc/timezone which will free you from the tad of slowness. |
Beta Was this translation helpful? Give feedback.
That's a great tip. If it suits your setup, you could probably also do this when extending the existing image in a Dockerfile sth like
which will free you from the tad of slowness.