chore: simplify timezone and database CLI setup#660
Merged
Conversation
/etc/timezone is not present or not a regular file on all hosts, including RHEL-family systems, and Docker can fail container startup when the bind mount source has the wrong type. See wekan/wekan#5123 for a CentOS example. Keep the /etc/localtime bind mount. glibc can determine the local timezone from the tzfile data in /etc/localtime, so mounting /etc/timezone is not required.
FlyGoat
marked this pull request as ready for review
June 25, 2026 11:30
Set DB_URI in Docker Compose service environments for components that use the Open5GS database. This lets docker exec shells inherit DB_URI directly, so tools like open5gs-dbctl can be run without relying on entrypoint-only exports.
FlyGoat
marked this pull request as draft
June 25, 2026 11:38
DB_URI is now supplied by Docker Compose, so HSS init no longer needs to create a mongo-to-mongosh symlink or patch open5gs-dbctl from localhost to MONGO_IP.
Use the webui container for open5gs-dbctl and document APN provisioning commands now that DB_URI is supplied by Docker Compose.
FlyGoat
marked this pull request as ready for review
June 25, 2026 12:07
Contributor
Author
|
Hi @herlesupreeth, apologise for the noise on editing the issue, I was trying to ask LLM agent to do some tree wide fixes but it went to far on creating the PR automatically. The change is in a good shape now, please review. Thanks |
herlesupreeth
left a comment
Owner
There was a problem hiding this comment.
Many thanks for this PR!!
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.
Summary
This PR removes host-specific timezone assumptions and makes Open5GS database tooling work from an exec shell without entrypoint patching.
Changes included:
/etc/timezone:/etc/timezone:robind mounts from all Docker Compose YAML files./etc/localtime:/etc/localtime:ro, which is sufficient for glibc to read local timezone data.DB_URI=mongodb://${MONGO_IP}/open5gsinto Docker Compose service environments for database-backed components.mongotomongoshand patchedopen5gs-dbctlfromlocalhostto$MONGO_IP.open5gs-dbctlfrom thewebuicontainer and include APN setup commands.Rationale
/etc/timezoneis not portable across Linux distributions. It may be missing or may not be a regular file on RHEL-family systems, which can make Docker fail during bind mount setup. A similar CentOS failure is documented in wekan/wekan#5123.Since glibc can determine timezone rules from the tzfile data in
/etc/localtime, the extra/etc/timezonebind mount is not required.Putting
DB_URIin Compose makes it part of the configured container environment. That means shells started withdocker exec, including interactive bash sessions, inherit the database URI directly and can runopen5gs-dbctlwithout runtime script edits.Validation
/etc/timezonereferences remain in Compose YAML files.export DB_URIentries remain.mongotomongoshsymlink or patchopen5gs-dbctl.bash -non both modified HSS init scripts.docker compose -f <file> config -qfor every modified Compose file.4g-volte-deploy.yamland confirmedDB_URIresolves tomongodb://172.22.0.2/open5gsfor services such aswebuiandhss.