Align dev container Instant Client TZ data with Oracle server#303
Merged
yahonda merged 1 commit intoMay 19, 2026
Merged
Conversation
Apply the workaround from rsim#292 to the dev container. CI fixed `ORA-01805: possible error in date/time operation` by copying the running Oracle server's `timezlrg_*.dat` into the Instant Client's `oracore/zoneinfo/` and pointing `ORA_TZFILE` at it. The dev container combines `gvenzl/oracle-free:latest` with the Instant Client installed via the app `Dockerfile`, so it is exposed to the same drift and benefits from the same fix. PR rsim#301 ported the workaround by adding the `docker-outside-of-docker` feature and copying the file from inside the dev container via `docker exec` / `docker cp`. That approach fails on Dev Containers 0.459.0 with the `mcr.microsoft.com/devcontainers/base:trixie` base image because Debian trixie removed `moby-cli`: (!) The 'moby' option is not supported on Debian 'trixie' because 'moby-cli' and related system packages have been removed from that distribution. ERROR: Feature "Docker (docker-outside-of-docker)" failed to install! Move the copy to the host, where Docker is already available. Mirrors rsim/oracle-enhanced#2799. - `.devcontainer/initializeCommand.sh` (new) -- pull `gvenzl/oracle-free:latest`, then extract `$ORACLE_HOME/oracore/zoneinfo/timezlrg_*.dat` from an ephemeral container into `.devcontainer/tzdata/` on the host. No DB start, no readiness wait -- the file ships in the image. - `.devcontainer/devcontainer.json` -- `initializeCommand` now runs the new script (it previously did the inline `docker pull`). The `docker-outside-of-docker` feature, added in rsim#301 and never merged to master, stays absent. - `.devcontainer/docker-compose.yml` -- bind-mount `.devcontainer/tzdata` read-only at `/opt/tzdata` inside the `app` service. - `.devcontainer/postCreateCommand.sh` -- set `ORA_TZFILE` from `/opt/tzdata/timezlrg_*.dat` and persist it via `/etc/profile.d/ora-tzfile.sh` so interactive shells and `bundle exec` runs pick it up. - `.gitignore` -- ignore `.devcontainer/tzdata/`. No `docker-outside-of-docker` feature, no `/var/run/docker.sock` bind, and no network access during the dev container build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Apply the workaround from #292 to the dev container. CI fixed
ORA-01805: possible error in date/time operationby copying the running Oracle server'stimezlrg_*.datinto the Instant Client'soracore/zoneinfo/and pointingORA_TZFILEat it. The dev container combinesgvenzl/oracle-free:latestwith the Instant Client installed via the appDockerfileand is exposed to the same drift, so it benefits from the same fix.#301 ported the workaround by adding the
docker-outside-of-dockerfeature and doing the copy from inside the dev container viadocker exec/docker cp. That PR was closed unmerged because the feature fails to install on Dev Containers 0.459.0 againstmcr.microsoft.com/devcontainers/base:trixie— Debian trixie removedmoby-cli:This PR moves the copy to the host, where Docker is already available. Mirrors rsim/oracle-enhanced#2799.
Changes
.devcontainer/initializeCommand.sh(new) — pullgvenzl/oracle-free:latest, then extract$ORACLE_HOME/oracore/zoneinfo/timezlrg_*.datfrom an ephemeral container into.devcontainer/tzdata/on the host. No DB start, no readiness wait — the file ships in the image..devcontainer/devcontainer.json—initializeCommandnow runs the new script (it previously did the inlinedocker pull). Nodocker-outside-of-dockerfeature..devcontainer/docker-compose.yml— bind-mount.devcontainer/tzdataread-only at/opt/tzdatainside theappservice..devcontainer/postCreateCommand.sh— setORA_TZFILEfrom/opt/tzdata/timezlrg_*.datand persist it via/etc/profile.d/ora-tzfile.shso interactive shells andbundle execruns pick it up..gitignore— ignore.devcontainer/tzdata/.No
docker-outside-of-dockerfeature, no/var/run/docker.sockbind, and no network access during the dev container build.Lifecycle
Matches #292 — the step is unconditional and becomes a near-zero-cost no-op once the Instant Client and the gvenzl image realign on a single TZ data version. Safe to remove together with the CI counterpart at that point.
Test plan
initializeCommandlogs the pulled image and the extractedtimezlrg_*.datfilename.postCreateCommandlogs "Using /opt/tzdata/timezlrg_*.dat for Instant Client TZ data."echo \$ORA_TZFILEresolves to the persisted path.bundle exec rake specpasses withoutORA-01805failures.🤖 Generated with Claude Code