Replies: 3 comments 8 replies
-
Hi @Slashoper , |
Beta Was this translation helpful? Give feedback.
2 replies
-
.envAIRFLOW__CORE__DEFAULT_TIMEZONE=Asia/Shanghai
AIRFLOW__WEBSERVER__DEFAULT_UI_TIMEZONE=Asia/Shanghai Retrieve TimeZone Beforedefault@2a4708cced03:/opt/airflow$ cat /etc/timezone && ls -l /etc/localtime
Etc/UTC
lrwxrwxrwx 1 root root 27 Sep 12 00:00 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC DockerfileRUN date
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN date Retrieve TimeZone Afterdefault@54092dee71fa:/opt/airflow$ cat /etc/timezone && ls -l /etc/localtime
Asia/Shanghai
lrwxrwxrwx 1 root root 33 Sep 27 10:46 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I want to modify the UTC time zone to Asia/Shanghai time zone in docker, what should I do? below is my docker image ,but it's does not work
FROM apache/airflow:2.2.4-python3.8 USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ openjdk-11-jre-headless curl procps\ && apt-get autoremove -yqq --purge \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN mkdir /opt/beeline \ && curl -SL https://archive.apache.org/dist/hadoop/core/hadoop-3.0.0/hadoop-3.0.0.tar.gz \ | tar -xzC /opt/beeline \ && curl -SL https://archive.apache.org/dist/hive/hive-2.1.1/apache-hive-2.1.1-bin.tar.gz \ | tar -xzC /opt/beeline \ && curl -SL https://repo1.maven.org/maven2/io/trino/trino-cli/389/trino-cli-389-executable.jar --output /opt/beeline/trino \ && chmod +x /opt/beeline/trino ENV HADOOP_HOME /opt/beeline/hadoop-3.0.0 ENV HIVE_HOME /opt/beeline/apache-hive-2.1.1-bin ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 ENV PATH $PATH:$HIVE_HOME/bin USER airflow COPY ./config/airflow-kube.cfg /opt/airflow/airflow.cfg COPY ./config/timezone.py /home/airflow/.local/lib/python3.8/site-packages/airflow/utils/timezone.py COPY ./config/sqlalchemy.py /home/airflow/.local/lib/python3.8/site-packages/airflow/utils/sqlalchemy.py RUN pip install --no-cache-dir apache-airflow-providers-apache-spark==2.1.0 \ && pip install --no-cache-dir apache-airflow-providers-apache-sqoop==2.1.0 \ && pip install trino \ && pip install trino[sqlalchemy] \ && pip install apache-airflow[password]
Beta Was this translation helpful? Give feedback.
All reactions