CloudSnorkel / cdk-github-runners

CDK constructs for self-hosted GitHub Actions runners
https://constructs.dev/packages/@cloudsnorkel/cdk-github-runners/
Apache License 2.0
320 stars 37 forks source link

ImageBuilder getting stuck due to lack of TZ #154

Closed andresionek91 closed 1 year ago

andresionek91 commented 1 year ago

When installing extra packages with ImageBuilder, we might come across a tzdata dependency. When that happens, codebuild will get stuck here:

Configuring tzdata
--
990 | ------------------
991 |  
992 | Please select the geographic area in which you live. Subsequent configuration
993 | questions will narrow this down by presenting a list of cities, representing
994 | the time zones in which they are located.
995 |  
996 | 1. Africa        6. Asia            11. System V timezones
997 | 2. America       7. Atlantic Ocean  12. US
998 | 3. Antarctica    8. Europe          13. None of the above
999 | 4. Australia     9. Indian Ocean
1000 | 5. Arctic Ocean  10. Pacific Ocean

I suggest setting the TZ to UTC in all docker images, like this:

ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
andresionek91 commented 1 year ago

A similar issue happens with keyboard-configuration. It can be avoided by adding the following to the Dockerfile:

ARG DEBIAN_FRONTEND=noninteractive
kichik commented 1 year ago

Looks like DEBIAN_FRONTEND=noninteractive solves both and even ends up with UTC as default. Thanks.