diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/README.md b/README.md index e457c96..357e9a1 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,25 @@ This repository provides a template-based workflow for VS Code Dev Containers. E Prerequisites: Docker is available on the host, and VS Code has the `ms-vscode-remote.remote-containers` extension installed. 1. Download the repository (e.g., `git clone https://github.com/iplaylf2/vscode-container.git`). -2. Copy `projects/.template/` to `projects/`. +2. Copy `projects/.template/` to `projects/` (Windows: do not copy; use `robocopy` in Notes). 3. Edit `projects//docker-compose.yaml` as needed. 4. Open `projects/` in VS Code and run `Dev Containers: Reopen in Container`. After the container is created, VS Code opens the workspace at `/mnt/`. The data lives in a Docker volume named `_workspace`. + +## Notes + +### Symlinks + +This repo uses symlinks under `projects/.template` for shared configuration. On Windows, run the following commands as Administrator: + +```powershell +# Enable symlink support in this repo. +git config --local core.symlinks true + +# Re-checkout files to restore symlinks when Git deleted them on Windows (destructive: discards local changes). +git checkout -f + +# Copy the template while preserving symlinks and skipping unchanged files. +robocopy projects/.template projects/ /E /SL /XC /XN /XO +``` diff --git a/projects/.template/.devcontainer/devcontainer.json b/projects/.template/.devcontainer/devcontainer.json index 76cd687..1d96b80 100644 --- a/projects/.template/.devcontainer/devcontainer.json +++ b/projects/.template/.devcontainer/devcontainer.json @@ -1,5 +1,9 @@ { "dockerComposeFile": "../docker-compose.yaml", + "features": { + // Use local features from this repo. + // "./features/uv": {} + }, "mounts": [ "source=workspace,target=${containerWorkspaceFolder},type=volume" ], diff --git a/projects/.template/.devcontainer/features b/projects/.template/.devcontainer/features new file mode 120000 index 0000000..767c681 --- /dev/null +++ b/projects/.template/.devcontainer/features @@ -0,0 +1 @@ +../../../features \ No newline at end of file diff --git a/projects/.template/docker-compose.yaml b/projects/.template/docker-compose.yaml index 2326893..6883436 100644 --- a/projects/.template/docker-compose.yaml +++ b/projects/.template/docker-compose.yaml @@ -2,7 +2,7 @@ services: devcontainer: build: # Pick the Dockerfile that matches your dev environment. - dockerfile: ../../images/base/Dockerfile + dockerfile: images/base/Dockerfile args: # Optional: toolchain version for Dockerfiles that accept SDK_VERSION. SDK_VERSION: 0 diff --git a/projects/.template/images b/projects/.template/images new file mode 120000 index 0000000..5fa6987 --- /dev/null +++ b/projects/.template/images @@ -0,0 +1 @@ +../../images \ No newline at end of file