File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 ]
1616 }
1717 },
18- "initializeCommand" : " docker pull gvenzl/oracle-free:latest " ,
18+ "initializeCommand" : " bash .devcontainer/initializeCommand.sh " ,
1919 "postCreateCommand" : " bash .devcontainer/postCreateCommand.sh" ,
2020 "remoteEnv" : {
2121 "DATABASE_NAME" : " FREEPDB1" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ services:
55 dockerfile : Dockerfile
66 volumes :
77 - ..:/workspaces/oracle-enhanced:cached
8+ - ./tzdata:/opt/tzdata:ro
89 command : sleep infinity
910 network_mode : service:oracle
1011
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ IMAGE=gvenzl/oracle-free:latest
6+ SCRIPT_DIR=$( cd " $( dirname " $0 " ) " && pwd)
7+ OUT_DIR=" $SCRIPT_DIR /tzdata"
8+
9+ docker pull " $IMAGE "
10+
11+ mkdir -p " $OUT_DIR "
12+ rm -f " $OUT_DIR " /timezlrg_* .dat " $OUT_DIR " /timezdif_* .dat
13+
14+ docker run --rm --entrypoint sh \
15+ -v " $OUT_DIR :/out" \
16+ " $IMAGE " \
17+ -c ' cp "$ORACLE_HOME"/oracore/zoneinfo/timezlrg_*.dat /out/ && chmod a+r /out/*.dat'
18+
19+ ls -1 " $OUT_DIR "
Original file line number Diff line number Diff line change 55gem update --system
66bundle install
77
8+ # Match Instant Client TZ data to the Oracle server's to avoid ORA-01805.
9+ # The file is extracted from the gvenzl image into .devcontainer/tzdata/ by
10+ # initializeCommand.sh and bind-mounted read-only at /opt/tzdata.
11+ TZ_FILE=$( ls /opt/tzdata/timezlrg_* .dat 2> /dev/null | head -1)
12+ if [ -n " $TZ_FILE " ]; then
13+ echo " Using $TZ_FILE for Instant Client TZ data."
14+ export ORA_TZFILE=" $TZ_FILE "
15+ echo " export ORA_TZFILE=$TZ_FILE " | sudo tee /etc/profile.d/ora-tzfile.sh > /dev/null
16+ else
17+ echo " Warning: no timezlrg_*.dat found under /opt/tzdata; skipping ORA_TZFILE setup." >&2
18+ fi
19+
820echo " Waiting for Oracle to be ready..."
921oracle_ready=false
1022for i in $( seq 1 30) ; do
Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ Gemfile.lock
1414ojdbc * .jar
1515.byebug_history
1616debug.log
17+ .devcontainer /tzdata /
You can’t perform that action at this time.
0 commit comments