解法:用VSCode在docker內開發flutter App遭遇tzdata問題
用VSCode在docker內開發flutter App
看到這篇介紹的超完整的,推薦要這樣開發都要看一下。
我自己照著它的介紹在把docker升到Ubuntu 20.04上試了一下,要小修一下Dockerfile內容。
升級到Ubuntu 20.04所以最前面的From就改成
FROM ubuntu:20.04
然後遭遇了tzdata的問題,vscode的外掛卡在build image階段沒回應,展開顯示LOG如下:
Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time
zones in which they are located.
1. Africa 3. Antarctica 5. Arctic Ocean 7. Atlantic Ocean 9. Indian Ocean 11. System V timezones 13. None of the above
2. America 4. Australia 6. Asia 8. Europe 10. Pacific Ocean 12. US
所以我嘗試了一下網路上的作法,在安裝tzdata時設定DEBIAN_FRONTEND環境變數為noninteractive,並然後我這裡設定TZ為+0800,之後image build就沒有問題囉!。
RUN apt update
RUN TZ="Asia/Taipei" DEBIAN_FRONTEND="noninteractive" apt install -y tzdata
RUN apt install -y tzdata curl git unzip xz-utils zip libglu1-mesa openjdk-8-jdk wget
留言