feat(container): map host data directory to container workspace

This commit is contained in:
kiskaadee committed 2026-10-14 19:40:14 -05:00
1 parent ee2d65c982
commit a612549e33
3 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
# Data directory for experiment files and test code
+6 -3
View File
@@ -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" "$@"