Timezone different container

Hello Toradex team,

I hope you are all doing great!

Hardware:

  • SoM Verdin IMX8M Plus Quad 4GB WB IT v1.1A
  • Heatsink Verdin Industrial Heatsink Type 1 V1.0B
  • Dual-Band Wi-Fi/Bluetooth PCB Antenna 100mm V1.0A
  • Custom Carrier Board based on Verdin

uname:

Linux verdin-imx8mp-15133026 5.15.191-6.8.4+git.88e9f1ec02f8 #1-TorizonCore SMP PREEMPT Sun Sep 14 21:18:28 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux

Images tested:

  • torizon-core-docker-verdin-imx8mp-Tezi_6.8.4+build.40.tar (STABLE Release)

Guest OS:

  • macOS (M1 Pro ARM64)
  • Linux ubuntu (VM x86_64)

Question:

I would like to know how to dynamically configure the timezone inside a Docker container running on TorizonCore.

Our use case: we ship devices to clients in different countries, and we need to be able to configure the appropriate timezone on each device before shipping. Ideally, we would like to:

  1. Set the container timezone during device provisioning (without rebuilding the container image)
  2. Be able to update the timezone remotely if needed after deployment

What is the recommended approach for achieving this on TorizonCore?

Thank you in advance for your help!

Best regards,
Maxence

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I can help you with dynamic timezone configuration for Docker containers on Torizon OS. While the provided sources don’t directly address timezone configuration, I can offer guidance based on the container architecture described in the documentation.

Recommended Approaches

1. Environment Variable Method

The most straightforward approach is to use the TZ environment variable when running your container:

docker run -e TZ=America/New_York your-container-image

2. Volume Mount Method

Mount the host’s timezone data into the container:

docker run -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro your-container-image

3. Dynamic Configuration via Docker Compose

For more complex deployments, use docker-compose with environment files:

Create a .env file:

TZ=Europe/Paris

Then reference it in your docker-compose.yml:

services:
  your-app:
    environment:
      - TZ=${TZ}

Setting Host Timezone

Since Torizon OS uses systemd, you can set the host timezone using timedatectl(1):

timedatectl set-timezone Europe/Paris

Remote Updates for Timezone Changes

For remote timezone updates after deployment, you can leverage Torizon’s OTA update capabilities(2). The Torizon platform provides secure remote updates that allow you to update container configurations without rebuilding images(3).

Production Deployment Strategy

For your use case of shipping to different countries:

  1. During Provisioning: Set the appropriate timezone via environment variables or host configuration before shipping
  2. Remote Updates: Use Torizon Cloud’s remote update capabilities to change timezone configurations post-deployment(2)
  3. Container Architecture: Leverage Torizon’s container-based architecture to keep timezone configuration separate from your application logic(3)

The container runtime in Torizon OS supports these configuration methods through Docker’s standard mechanisms(3).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hello @unablesalt,

The suggestions from the Toradex AI here are good.

Using the TZ environment variable should allow this to be controllable depending on some configurations.
There are different valid implementations that could be done:

  • Using different docker-compose files, where the enviroment variables are changed, but the containers remain the same.
  • Using a .env file which is used by the container, this file could be either:

Each approach has their own advantages or disadvantages, depending on the level of flexibility needed for your use case.

Best Regards,
Bruno

1 Like

Hi @bruno.tx,

I’ll go with the .env, looks the easiest way to achieve what I want to do.

Appreciate your help.

Best,
M

1 Like