From a612549e335b7f3eea65a6cff095000509c60827 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Wed, 14 Oct 2026 19:40:14 -0500 Subject: [PATCH] feat(container): map host data directory to container workspace --- README.md | 2 +- data/.gitkeep | 1 + enter.sh | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 data/.gitkeep diff --git a/README.md b/README.md index a1c8c58..0afe05c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The environment runs Void Linux inside Docker and includes: - **Documentation**: `man-pages`, `man-db` - **Utilities**: `tree`, `less`, `curl`, `vim`, `nano` -The container mounts the repository root directly at `/home/kiskaadee/fds` with matching host user UID (1000) so any code or notes created inside persist across container sessions. Tracing capabilities (`SYS_PTRACE`) are enabled. +The container mounts the `./data` directory directly at `/home/kiskaadee/fds` with matching host user UID (1000) so any code or notes created inside persist across container sessions while keeping the repository root clean. Tracing capabilities (`SYS_PTRACE`) are enabled. ## Quick Start diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..144d41e --- /dev/null +++ b/data/.gitkeep @@ -0,0 +1 @@ +# Data directory for experiment files and test code diff --git a/enter.sh b/enter.sh index 057faf5..d1c157d 100755 --- a/enter.sh +++ b/enter.sh @@ -5,20 +5,23 @@ set -euo pipefail IMAGE_NAME="fds:latest" WORKSPACE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DATA_DIR="$WORKSPACE_DIR/data" +mkdir -p "$DATA_DIR" + # Ensure the container image exists; build it if missing if ! docker image inspect "$IMAGE_NAME" >/dev/null 2>&1; then echo "🔨 Building Docker image '$IMAGE_NAME'..." docker build -t "$IMAGE_NAME" "$WORKSPACE_DIR" fi -echo "🚀 Entering $IMAGE_NAME container (workspace: $WORKSPACE_DIR)..." +echo "🚀 Entering $IMAGE_NAME container (workspace: $DATA_DIR)..." # Run container interactively: -# - Mount local directory to /home/kiskaadee/fds for persistent work +# - Mount host data directory to /home/kiskaadee/fds for persistent work # - Grant SYS_PTRACE and unconfined seccomp to allow strace / proc inspection of file descriptors exec docker run --rm -it \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ - -v "$WORKSPACE_DIR:/home/kiskaadee/fds" \ + -v "$DATA_DIR:/home/kiskaadee/fds" \ -w /home/kiskaadee/fds \ "$IMAGE_NAME" "$@"