PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

add build timezone args in docker-compose.yml

Open rovmelek opened this issue 10 years ago • 7 comments

original:

bot1-pokego: build: .

proposed:

bot1-pokego: build: context: . args: timezone: US/Pacific

so the task "SleepSchedule" can work properly for users in different timezones.

rovmelek avatar Aug 18 '16 23:08 rovmelek

SleepSchedule works based on your own system clock and timezone.

dooodledad avatar Aug 18 '16 23:08 dooodledad

it seems not to be the case when i run "docker-compose up"

bot1-pokego_1 | 2016-08-18 23:10:33,882 [PokemonGoBot] [INFO] bot1-pokego_1 | 2016-08-18 23:10:33,885 [SleepSchedule] [INFO] [next_sleep] Next sleep at 2016-08-19 19:41:37.885836 bot1-pokego_1 | 2016-08-18 23:10:34,258 [PokemonGoBot] [INFO] [bot_start] Starting bot... bot1-pokego_1 | 2016-08-18 23:10:34,269 [SleepSchedule] [INFO] [bot_sleep] Sleeping for 10:48:19, wake at 2016-08-19 09:58:53.885860

mbp:PokemonGo-Bot $ date Thu Aug 18 16:11:59 PDT 2016 mbp:PokemonGo-Bot $

rovmelek avatar Aug 18 '16 23:08 rovmelek

==== without the timezone in docker-compose.yml

Step 5 : RUN echo $timezone > /etc/timezone && ln -sfn /usr/share/zoneinfo/$timezone /etc/localtime && dpkg-reconfigure -f noninteractive tzdata ---> Running in fd5f25373063

Current default time zone: 'Etc/UTC' Local time is now: Thu Aug 18 23:09:42 UTC 2016. Universal Time is now: Thu Aug 18 23:09:42 UTC 2016.

---> a16c990e5184 Removing intermediate container fd5f25373063

==== add timezone as part of the build args

Step 5 : RUN echo $timezone > /etc/timezone && ln -sfn /usr/share/zoneinfo/$timezone /etc/localtime && dpkg-reconfigure -f noninteractive tzdata ---> Running in b9eda547df84

Current default time zone: 'America/Los_Angeles' Local time is now: Thu Aug 18 16:16:19 PDT 2016. Universal Time is now: Thu Aug 18 23:16:19 UTC 2016.

---> 958cac362519 Removing intermediate container b9eda547df84

rovmelek avatar Aug 18 '16 23:08 rovmelek

I don't use docker, but I'm positive it's your docker config. Try one of the suggestions here: https://www.google.com/search?q=set+docker+timezone&oq=set+docker+timezone

dooodledad avatar Aug 18 '16 23:08 dooodledad

@rovmelek this us a tricky one... since docker-compose does not support passing --build-args then we can support only one timezone...

your proposal to change to something else will become the default for everybody...

what exactly is the problem with the SleepSchedule?

timezone: US/Pacific

so the task "SleepSchedule" can work properly for users in different timezones.

th3w4y avatar Aug 27 '16 17:08 th3w4y

#4954 closed this, correct?

mjmadsen avatar Aug 31 '16 06:08 mjmadsen

@mjmadsen yes

walkerlee avatar Aug 31 '16 14:08 walkerlee