Skip to content

feat(docker): mount host zoneinfo for container timezone (#863)#877

Merged
Issac-Newton merged 4 commits intoalibaba:masterfrom
Issac-Newton:feature/tz-mount-localtime
Apr 22, 2026
Merged

feat(docker): mount host zoneinfo for container timezone (#863)#877
Issac-Newton merged 4 commits intoalibaba:masterfrom
Issac-Newton:feature/tz-mount-localtime

Conversation

@Issac-Newton
Copy link
Copy Markdown
Collaborator

Summary

  • Mount host zoneinfo file (/usr/share/zoneinfo/{tz}) to container /etc/localtime:ro, giving containers correct timezone without requiring tzdata in the image
  • ROCK_TIME_ZONE default now falls back to host TZ env var: ROCK_TIME_ZONETZAsia/Shanghai
  • Added spec docs and integration test for timezone mount behavior

fixes #863

Test plan

  • Integration test test_docker_deployment_mounts_localtime_in_container verifies container UTC offset matches host
  • Verify date inside container shows correct timezone when host has zoneinfo
  • Verify container falls back to UTC when host zoneinfo file is missing

🤖 Generated with Claude Code

Issac-Newton and others added 4 commits April 22, 2026 14:55
…iner timezone

Instead of passing a POSIX TZ env var, mount the host's zoneinfo file
(e.g. /usr/share/zoneinfo/Asia/Shanghai) to /etc/localtime:ro so
containers get full IANA timezone support without requiring tzdata
inside the image.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Priority: ROCK_TIME_ZONE > TZ > Asia/Shanghai (default).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ookup

Using a dedicated ROCK_TIME_ZONE avoids conflicts when users specify
their own TZ in sandbox launch parameters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Issac-Newton Issac-Newton merged commit 591f9d4 into alibaba:master Apr 22, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

feat: pass standard TZ env var to Docker sandbox containers

2 participants