Hi
Thank you for the docker-gitlab first.
I use the GITLAB_BACKUPS=daily, and find the backup file is done by 6:00 am,
If I understand right, my time zone is not as same as yours.
I can ssh to the container and change, but ...
Is there better way to do this date setup?
@WeiLiPenguin The backups are generated at 4am UTC. Since it is in UTC the local time may not be 4am. I should be able to add an option to specify the time the backup should be taken.
Regarding timezone refer https://github.com/dotcloud/docker/issues/3359
@WeiLiPenguin There are two ways to set the timezone of the container. First method is to mount the /etc/localtime file on the host to the container at the same path -v /etc/localtime:/etc/localtime:ro. This will make sure that the timezone on the host and the container are the same.
The second method is to define the TZ environment variable while running the image. For example, -e "TZ=Asia/Kolkata" or -e "TZ=Asia/Dubai", etc.
With this, I do not see the need for adding an option to specify the backup time.
A correction, The automated backups are generated at 4am not 6am as you stated in your original message.
Just wanted to offer a variation (or more like a combination) of @sameersbn 's suggestion on how we're doing this
docker run option:
-e TZ=${TZ-`readlink /etc/localtime | sed -e 's,/usr/share/zoneinfo/,,'`}
And then this initialization is executed in the entrypoint.sh, since our java applications don't use the TZ environment variable:
if [ -n ${TZ} ] && [ -f /usr/share/zoneinfo/${TZ} ]; then
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime
fi
How can i change jre so that i dont have to use command because command line doesnot work for my issue. i need to manually update with tzupdate for daylight http://stackoverflow.com/questions/40418187/update-docker-contanier-jre-timezone
Most helpful comment
@WeiLiPenguin There are two ways to set the timezone of the container. First method is to mount the /etc/localtime file on the host to the container at the same path
-v /etc/localtime:/etc/localtime:ro. This will make sure that the timezone on the host and the container are the same.The second method is to define the TZ environment variable while running the image. For example,
-e "TZ=Asia/Kolkata"or-e "TZ=Asia/Dubai", etc.With this, I do not see the need for adding an option to specify the backup time.
A correction, The automated backups are generated at 4am not 6am as you stated in your original message.