feat: fix dockerfile missing package (tzdata)#160
Merged
hsluoyz merged 2 commits intoapache:masterfrom Feb 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a runtime panic in the Docker container by adding the missing tzdata package to the Alpine Linux base image. The application uses time.LoadLocation("Asia/Singapore") in the util.GetCurrentTime() function, which requires timezone data that Alpine doesn't include by default.
Changes:
- Added
tzdatapackage to the Alpine package installation in the Dockerfile
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 1.72.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alpine Linux (used in the Dockerfile) doesn't include timezone data by default, which causes the error:
the request url is /api/add-rule 2026/02/16 00:54:06.483 [C] [panic.go:884] Handler crashed with error unknown time zone Asia/Singapore 2026/02/16 00:54:06.483 [C] [panic.go:884] /usr/local/go/src/runtime/panic.go:884 2026/02/16 00:54:06.483 [C] [panic.go:884] /go/src/caswaf/util/time.go:22 2026/02/16 00:54:06.483 [C] [panic.go:884] /go/src/caswaf/controllers/rule.go:91 2026/02/16 00:54:06.483 [C] [panic.go:884] /usr/local/go/src/reflect/value.go:586 2026/02/16 00:54:06.483 [C] [panic.go:884] /usr/local/go/src/reflect/value.go:370 2026/02/16 00:54:06.483 [C] [panic.go:884] /go/pkg/mod/github.com/beego/beego@v1.12.12/router.go:897 2026/02/16 00:54:06.483 [C] [panic.go:884] /usr/local/go/src/net/http/server.go:2936 2026/02/16 00:54:06.483 [C] [panic.go:884] /usr/local/go/src/net/http/server.go:1995 2026/02/16 00:54:06.483 [C] [panic.go:884] /usr/local/go/src/runtime/asm_amd64.s:1598To fix that, we have to add the
tzdatapackage installer to the Dockerfile.