[PYTHON] [Dockerfile] About tzdata settings

Purpose

I tried to create a docker image to install jupyterlab on ubuntu on Docker.

Clogged problem

In order to create a docker image from a Dockerfile, try to execute the following file (dockerfile) with a command ...

dockerfile


FROM ubuntu

RUN apt-get update
RUN apt-get install -y sudo
RUN sudo apt install -y python3-pip
RUN sudo apt install -y language-pack-ja
RUN sudo update-locale LANG=ja_JP.UTF-8
RUN sudo apt install -y nodejs npm
RUN pip3 install jupyterlab
RUN pip3 install pandas
RUN pip3 install matplotlib
RUN pip3 install sklearn

The command is as follows.

docker build -t jupyterlab:latest ./

However, the following is displayed during execution

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      4. Australia  7. Atlantic  10. Pacific  13. Etc
  2. America     5. Arctic     8. Europe    11. SystemV
  3. Antarctica  6. Asia       9. Indian    12. US
Geographic area:

At this time, typing 6 and pressing Enter did not respond ... Apparently selecting a timezone will solve it.

Solution

It was solved by adding a statement to set the time zone to the above docker file. (Additional sentence)

FROM ubuntu

RUN apt-get update
RUN apt-get install -y sudo
RUN sudo apt install -y python3-pip
RUN sudo apt install -y language-pack-ja
RUN sudo update-locale LANG=ja_JP.UTF-8
#Added sentence ↓
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Moscow
RUN apt-get install -y tzdata

RUN sudo apt install -y nodejs npm
RUN pip3 install jupyterlab
RUN pip3 install pandas
RUN pip3 install matplotlib
RUN pip3 install sklearn

Recommended Posts

[Dockerfile] About tzdata settings
Forget about cron settings! (RHEL 6.x, 7x series)