Skip to content

Instantly share code, notes, and snippets.

@alecthegeek
Last active March 3, 2022 10:37
Show Gist options
  • Save alecthegeek/e0674af5f17e55bba9ab5505a4eae83b to your computer and use it in GitHub Desktop.
Save alecthegeek/e0674af5f17e55bba9ab5505a4eae83b to your computer and use it in GitHub Desktop.
Runs a Dot net development env
#!/usr/bin/env bash
docker container run --rm -it --user $(id -u):$(id -g) \
--mount "type=bind,source=$PWD,target=/testproj" \
--workdir /testproj --env HOME=/testproj/dotnetcache mcr.microsoft.com/dotnet/sdk:6.0 "$@"
@alecthegeek
Copy link
Author

For PowerShell

Function dotnet {
&"docker.exe" container run --rm -it --user "$(wsl -e id -u):$(wsl -e id -g)" --mount "type=bind,source=$PWD,target=/testproj"
--workdir /testproj --env HOME=/testproj/dotnetcache mcr.microsoft.com/dotnet/sdk:6.0 dotnet $args}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment