Apply ORA_TZFILE workaround to devcontainer#301
Closed
yahonda wants to merge 1 commit into
Closed
Conversation
rsim#292 added the ORA-01805 workaround to the remaining `gvenzl/oracle-free` CI workflows. The same root cause -- the server image shipping a newer timezone-data version than the "latest" Instant Client embeds -- affects the dev container, which combines `gvenzl/oracle-free:latest` (Oracle service) with the Instant Client installed via the app `Dockerfile` and talks to it through ruby-oci8. Mirror the workflow step in `postCreateCommand.sh` immediately after `ci/setup_accounts.sh`: locate the running Oracle container, copy its `timezlrg_*.dat` onto the Instant Client's `oracore/zoneinfo`, and persist `ORA_TZFILE` via `/etc/profile.d/ora_tzfile.sh` so every login shell (and the rspec runs they launch) sees the override. The Docker CLI and the host docker socket needed to drive `docker exec` / `docker cp` are provided by the standard `ghcr.io/devcontainers/features/docker-outside-of-docker` feature, added alongside the existing Ruby feature in `devcontainer.json`. The lookup is dynamic, so a future gvenzl image bump continues to work without further edits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
It does not looks like we need this. |
4 tasks
yahonda
added a commit
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
ORA-01805workaround to the remaininggvenzl/oracle-freeCI workflows. The same root cause -- the server image shipping a newer timezone-data version than the "latest" Instant Client embeds -- also affects the dev container, which pairsgvenzl/oracle-free:latestwith the Instant Client installed via the appDockerfileand reaches it through ruby-oci8..devcontainer/postCreateCommand.shright afterci/setup_accounts.sh: locate the running Oracle container, copy itstimezlrg_*.datonto the Instant Client'soracore/zoneinfo, and persistORA_TZFILEvia/etc/profile.d/ora_tzfile.shso every login shell (and the rspec runs they launch) picks it up.ghcr.io/devcontainers/features/docker-outside-of-dockeralongside the existing Ruby feature in.devcontainer/devcontainer.jsonto provide the Docker CLI and host socket the workaround needs fordocker exec/docker cp.The lookup is dynamic, so a future gvenzl image bump continues to work without further edits.
Test plan
postCreateCommand.shfinishes withDev container setup complete.and a non-emptyORA_TZFILEline in/etc/profile.d/ora_tzfile.sh.echo \$ORA_TZFILEprints the copiedtimezlrg_*.datunder\$ORACLE_HOME/oracore/zoneinfo, and that the file exists.ORA-01805.🤖 Generated with Claude Code