How to Set Timezone in Docker Container via Docker-Compose #4083
-
QuestionHi everyone, I am using a docker compose file to run mediamtx image on raspberry-pi 4b. My local pi timezone is I tried to setup Here is the version: '3'
services:
tapo-server:
image: bluenviron/mediamtx:latest
container_name: tapo-server
network_mode: host
volumes:
- /home/piyush/tapo:/tapo
- /home/piyush/tapo/config/mediamtx.yml:/mediamtx.yml
environment:
- TZ=Asia/Kolkata
- PUSH_BULLET_API=XXXX
restart: unless-stopped
volumes:
tapo:
driver: local
logLevel: info
logDestinations: [ file ]
logFile: /tapo/logs/cam.log
readTimeout: 10s
writeTimeout: 10s
#writeQueueSize: 8192
rtsp: yes
protocols: [ udp, multicast, tcp ]
record: yes
recordFormat: mpegts
recordPath: /tapo/recordings/%path/%Y-%m-%d_%H-%M-%S-%f
recordSegmentDuration: 5m
recordDeleteAfter: 12h
hlsAlwaysRemux: yes
hlsVariant: fmp4
hlsSegmentCount: 180
hlsSegmentDuration: 10s
hlsPartDuration: 1s
hlsSegmentMaxSize: 50M
hlsDirectory: /tapo/hls/
hlsMuxerCloseAfter: 1800s
metrics: yes
paths:
cam1:
source: rtsp://xxx:[email protected]:554/stream1
sourceProtocol: tcp
rtspTransport: tcp
cam2:
source: rtsp://xxx:[email protected]:554/stream1
sourceProtocol: tcp
rtspTransport: tcp Can anyone help me out how can change the container timezone from UTC to Asia/Kolkata. Another Question:Also when I was recording my videos in Is there any way to use the playback for Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is resolved. After mapping these additional volumes it is working. volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro Found this solution from this issue: |
Beta Was this translation helpful? Give feedback.
This is resolved. After mapping these additional volumes it is working.
Note: TZ environment has been removed from docker-compose file.
Found this solution from this issue:
#3390