Align dev container Instant Client TZ data with Oracle server#2799
Merged
Conversation
fc86a2f to
d11547f
Compare
2 tasks
CI applies the same workaround in rsim#2734 to dodge ORA-01805 caused by drift between gvenzl/oracle-free:latest and the bundled Instant Client. Mirror it for the dev container without dragging the Docker CLI into the dev container itself. initializeCommand runs on the host, where Docker is already available. Pull the gvenzl image and copy timezlrg_*.dat out of it via an ephemeral container, dropping the file under .devcontainer/tzdata/ on the host. docker-compose bind-mounts that directory read-only at /opt/tzdata inside the dev container, and postCreateCommand exports ORA_TZFILE from there and persists it via /etc/profile.d so interactive shells and bundle exec runs pick it up. The TZ data ships in the image, so the copy step does not start Oracle or wait for the database. No docker-outside-of-docker feature, no /var/run/docker.sock bind mount, and no GPG-key fetching at build time.
d11547f to
4d754b0
Compare
4 tasks
yahonda
added a commit
to rsim/ruby-plsql
that referenced
this pull request
May 19, 2026
Apply the workaround from #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 #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 #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 #2734 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 is exposed to the same drift betweengvenzl/oracle-free:latestand the bundled Instant Client and benefits from the same fix.The earlier revision of this PR did the copy from inside the dev container via
docker exec/docker cp, which dragged in thedocker-outside-of-dockerfeature, a/var/run/docker.sockbind mount, and amoby: falseworkaround for Debian trixie — and made the dev container build hit a build-time GPG-key fetch that was flaky.This revision moves the copy to the host, where Docker is already available.
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 just did the inlinedocker pull)..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, nomoby: falseworkaround, and no network access during the dev container build.Lifecycle
Matches #2734 — the step is unconditional and becomes a near-zero-cost no-op once the Instant Client and 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 rspec spec/active_record/oracle_enhanced/type/timestamp_spec.rbpasses (all four examples).