Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
volumes:
- ..:/workspaces/oracle-enhanced:cached
- ./tzdata:/opt/tzdata:ro
- ${GIT_COMMON_DIR}:${GIT_COMMON_DIR}:cached
command: sleep infinity
network_mode: service:oracle

Expand Down
14 changes: 14 additions & 0 deletions .devcontainer/initializeCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euo pipefail

IMAGE=gvenzl/oracle-free:latest
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
WORKSPACE_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
OUT_DIR="$SCRIPT_DIR/tzdata"

docker pull "$IMAGE"
Expand All @@ -17,3 +18,16 @@ docker run --rm --entrypoint sh \
-c 'cp "$ORACLE_HOME"/oracore/zoneinfo/timezlrg_*.dat /out/ && chmod a+r /out/*.dat'

ls -1 "$OUT_DIR"

# When opened from a git worktree, .git is a file whose `gitdir:` line points
# at the main repo's .git/worktrees/<branch>. That host path is not visible
# inside the dev container by default, so git commands inside the container
# fail with "fatal: not a git repository". Resolve the common git dir on the
# host and write it to .devcontainer/.env; docker-compose.yml bind-mounts it
# at the same path inside the container so the gitdir reference resolves.
GIT_COMMON_DIR=$(git -C "$WORKSPACE_DIR" rev-parse --git-common-dir)
case "$GIT_COMMON_DIR" in
/*) ;;
*) GIT_COMMON_DIR=$(cd "$WORKSPACE_DIR/$GIT_COMMON_DIR" && pwd) ;;
esac
printf 'GIT_COMMON_DIR=%s\n' "$GIT_COMMON_DIR" > "$SCRIPT_DIR/.env"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ ojdbc*.jar
.byebug_history
debug.log
.devcontainer/tzdata/
.devcontainer/.env