Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker image does not recognise timezone appropriately #3040

Open
instantdreams opened this issue Apr 16, 2024 · 0 comments
Open

docker image does not recognise timezone appropriately #3040

instantdreams opened this issue Apr 16, 2024 · 0 comments

Comments

@instantdreams
Copy link

Description

Date on host reports according to timezone. Date on container reports in UTC.

Configuration

  1. Create a mosquitto compose.yaml file:
compose.yaml

services:
  mosquitto:
    image: eclipse-mosquitto:latest
    container_name: mqtt
    hostname: mqtt
    ports:
      - 1883:1883 # mqtt
      - 9001:9001 # websockets
    environment:
      - TZ=America/Edmonton
    volumes:
      - /srv/mqtt/config:/mosquitto/config
      - /srv/mqtt/data:/mosquitto/data
      - /srv/mqtt/log:/mosquitto/log
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped

  1. Run compose file using docker compose up --detach

Reproducing Issue

  1. Ensure the container is running
  2. Issue the following commands:
$ docker exec mqtt date
Tue Apr 16 15:35:43 UTC 2024
$ docker exec mqtt cat /etc/timezone
America/Edmonton
  1. Confirm container is running successfully

Environment

  • Docker Compose version v2.24.7
  • Docker version 25.0.4, build 1a576c5
  • mosquitto version 2.0.18

Expectation

To rebuild the mqtt docker container to include the tzdata component so it is timezone aware, or to implement another process to support timezones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant