Skip to content

Align dev container Instant Client TZ data with Oracle server#303

Merged
yahonda merged 1 commit into
rsim:masterfrom
yahonda:align-devcontainer-instant-client-tz-data
May 19, 2026
Merged

Align dev container Instant Client TZ data with Oracle server#303
yahonda merged 1 commit into
rsim:masterfrom
yahonda:align-devcontainer-instant-client-tz-data

Conversation

@yahonda
Copy link
Copy Markdown
Collaborator

@yahonda yahonda commented May 19, 2026

Summary

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 and is exposed to the same drift, so it benefits from the same fix.

#301 ported the workaround by adding the docker-outside-of-docker feature and doing the copy from inside the dev container via docker exec / docker cp. That PR was closed unmerged because the feature fails to install on Dev Containers 0.459.0 against mcr.microsoft.com/devcontainers/base:trixie — 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!

This PR moves the copy to the host, where Docker is already available. Mirrors rsim/oracle-enhanced#2799.

Changes

  • .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.jsoninitializeCommand now runs the new script (it previously did the inline docker pull). No docker-outside-of-docker feature.
  • .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.

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

  • Rebuild the dev container; initializeCommand logs the pulled image and the extracted timezlrg_*.dat filename.
  • postCreateCommand logs "Using /opt/tzdata/timezlrg_*.dat for Instant Client TZ data."
  • In a fresh terminal inside the rebuilt container, echo \$ORA_TZFILE resolves to the persisted path.
  • bundle exec rake spec passes without ORA-01805 failures.

🤖 Generated with Claude Code

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>
@yahonda yahonda merged commit c7ade38 into rsim:master May 19, 2026
20 checks passed
@yahonda yahonda deleted the align-devcontainer-instant-client-tz-data branch May 19, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant