Time Zone Settings Not Effective in Docker Container
FreemanKevin opened this issue · comments
Kevin commented
I am encountering an issue where the time zone settings in the MinIO Docker container do not take effect. I have tried setting the time zone using both the TZ environment variable and by mapping the /etc/localtime
file, but the container still does not reflect the correct time zone (Asia/Shanghai).
Steps to Reproduce
- Pull the latest MinIO Docker image.
- Configure
docker-compose.yml
with the necessary time zone settings. - Run the container using
docker-compose up
. - Check the time inside the container using
docker exec -it [container_name] date
.
Expected Behavior
The time inside the container should reflect the Asia/Shanghai time zone when checked.
Actual Behavior
The container time does not change and does not reflect the Asia/Shanghai time zone.
Environment Details
- MinIO Version: minio/minio:latest
- Docker Version: v25.0.5
- Docker Compose Version: v2.24.5
- Operating System and Version: MacBook M2
Configuration Used
# version: '3.8'
services:
minio:
image: minio/minio:latest
volumes:
- ./data:/data
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
ports:
- "9000:9000"
- "9001:9001"
environment:
- TZ=Asia/Shanghai
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
command: server /data --console-address ":9001"
Harshavardhana commented
We do not care about your local tz. All time in MinIO is UTC