Monorepo for Aesthetic.Computer aesthetic.computer
at main 24 lines 852 B view raw
1#!/usr/bin/env fish 2# Helper for Docker-in-Docker with correct volume mounts in dev containers 3# Usage: docker-dev-mount smartpy-amd64:0.23.1 python3 /workspace/script.py 4 5# Get the host path for the workspace 6set HOST_PATH (docker inspect (cat /etc/hostname) 2>/dev/null | jq -r '.[0].Mounts[] | select(.Destination == "/workspaces/aesthetic-computer") | .Source' 2>/dev/null) 7 8if test -z "$HOST_PATH" 9 echo "Error: Could not determine host path for workspace" 10 exit 1 11end 12 13# Get current directory from PWD environment variable 14set CURRENT_DIR $PWD 15set CONTAINER_PATH /workspaces/aesthetic-computer 16 17# Calculate relative path 18set REL_PATH (string replace $CONTAINER_PATH "" $CURRENT_DIR) 19 20# Build mount path 21set MOUNT_PATH "$HOST_PATH$REL_PATH" 22 23echo "✓ Mounting: $MOUNT_PATH -> /workspace" 24docker run --rm -v "$MOUNT_PATH:/workspace" $argv