{"id":16203751,"url":"https://github.com/mayuki/dotnet-sail","last_synced_at":"2025-08-12T17:42:07.164Z","repository":{"id":215542480,"uuid":"738591454","full_name":"mayuki/dotnet-sail","owner":"mayuki","description":"Downloads .NET project from Gist, GitHub, Git, or the web and runs it in a container.","archived":false,"fork":false,"pushed_at":"2024-01-05T01:10:57.000Z","size":1190,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T00:11:20.462Z","etag":null,"topics":["container-image","csharp","dotnet"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mayuki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-03T15:26:20.000Z","updated_at":"2025-03-30T02:54:29.000Z","dependencies_parsed_at":"2024-01-05T03:46:00.723Z","dependency_job_id":null,"html_url":"https://github.com/mayuki/dotnet-sail","commit_stats":null,"previous_names":["mayuki/dotnet-sail"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mayuki/dotnet-sail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayuki%2Fdotnet-sail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayuki%2Fdotnet-sail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayuki%2Fdotnet-sail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayuki%2Fdotnet-sail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mayuki","download_url":"https://codeload.github.com/mayuki/dotnet-sail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayuki%2Fdotnet-sail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108485,"owners_count":24528760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container-image","csharp","dotnet"],"created_at":"2024-10-10T09:55:00.694Z","updated_at":"2025-08-12T17:42:07.101Z","avatar_url":"https://github.com/mayuki.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⛵ dotnet-sail\nDownloads .NET project from Gist, GitHub, Git, or the web and runs it in a container. No CI or container registry required.\n\nThis container image performs **Download** (`git clone` or HTTP), **Build** (`dotnet build`), and **Run** (`dotnet run`) all at once, simply by specifying the source code address.\n\n\u003e [!IMPORTANT]\n\u003e dotnet-sail is primarily intended for temporary execution such as development, validation, and running sample code, and is not meant for use in production environments or the inner loop of day-to-day development.\n\n## Example: Run [ASP.NET Core app from Gist](https://gist.github.com/mayuki/6779e703c81333457aef4a3271d6d5c5)\n```\ndocker run --rm -it -p 8080:8080 mayuki/dotnet-sail https://gist.github.com/mayuki/6779e703c81333457aef4a3271d6d5c5\n```\n![](docs/images/recording-02.gif)\n\n\n## Example: Run [Blazor sample app (dotnet/blazor-samples)](https://github.com/dotnet/blazor-samples/)\n```\ndocker run --rm -it -p 8080:8080 mayuki/dotnet-sail -r publish https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorSample_BlazorWebApp\n```\n![](docs/images/recording-01.gif)\n\u003e [!NOTE]\n\u003e To run a Blazor app, `publish` mode or `DOTNET_URLS` environment variable must be specified.\n\n## How to use\nThe container images are available from the following container registries:\n\n- mayuki/dotnet-sail (Docker Hub)\n- ghcr.io/mayuki/dotnet-sail (GitHub Packages Container Registry)\n\n### Run from Gist\n```\ndocker run --rm -it mayuki/dotnet-sail https://gist.github.com/mayuki/d052d7457a63f25763ce8ecf04b1d0fc\n```\n\nIf the Gist contains only one C# file, it automatically generates a C# project and starts it. If the Gist includes a .csproj file, it uses that to start the project.\n\n### Run from GitHub\n```\ndocker run --rm -it -p 8080:8080 -e mayuki/dotnet-sail https://github.com/mayuki/dotnet-sail/tree/main/samples/SampleWebApp/SampleWebApp.csproj\n```\n\n#### Allowed URL forms\n- `https://github.com/\u003corg\u003e/\u003crepo\u003e`\n- `https://github.com/\u003corg\u003e/\u003crepo\u003e/tree/\u003cbranch-or-hash\u003e/\u003cpath-to-source-directory\u003e`\n- `https://github.com/\u003corg\u003e/\u003crepo\u003e/blob/\u003cbranch-or-hash\u003e/\u003cpath-to-source-directory\u003e/\u003ctarget\u003e.csproj`\n\n\n### Run from Git\n```\ndocker run --rm -it -p 8080:8080 mayuki/dotnet-sail https://github.com/mayuki/dotnet-sail.git?path=samples/SampleWebApp/SampleWebApp.csproj\u0026branch=main\n```\n\n#### Options\n- `path`: The path of the directory or file that includes projects and sources within the repository.\n- `branch`: The branch to checkout when cloning the repository.\n\n\n## What does this do to help?\n\n- Running temporary verification project\n- Running samples or demonstration applications\n- Hosting in environments where images can be easily run like Azure Container Instance, Container Apps, or Google Cloud Run\n\nTypically, to run applications in container execution environments, you need to build for deployment, store build artifacts (container images), and set up secrets to make them deployable.\n\nHowever, such settings are annoying when building a temporary environment for development, verification, or demonstration application. This container image realizes the developer's need to \"I just want to run the source code that is here now.\"\n\n## What is this not intended for?\n\n- Use in production environments\n- Use as a day-to-day development environment\n\nThe container image is **very large** because it includes the .NET SDKs, and in addition, it requires time to fetch the source code and build it each time it starts up. This overhead becomes non-negligible for regular usage. For general development purposes, it is recommended to set up a CI/CD mechanism.\n\nAlso, at this point, there is no provided method for configuring authentication when fetching source code.\n\n## Command line options and environment variables\n|Environemnt variable|Command option|Description|\n|--|--|--|\n|DOTNET_SAIL_SOURCE|`-s`, `--source`|Gist, GitHub, or any other address that provides source code. (https://, git://...) Can be used instead of passing it as an argument.|\n|DOTNET_SAIL_ARGUMENTS||The arguments to be passed to the application.|\n|DOTNET_SAIL_VERBOSITY|`-v`, `--verbosity`|Set the verbosity level. The default is 'Information'. Allowed values are `None`, `Error`, `Information` and `Trace`.|\n|DOTNET_SAIL_RUNNER|`-r`, `--runner`|The strategy to run for. The default is 'DotNetRunRunner'. \u003cbr\u003eAvailable runners are: \u003cbr\u003e\u003cul\u003e\u003cli\u003e`DotNetRunRunner`, `run`: Use 'dotnet build' and 'dotnet run'\u003c/li\u003e\u003cli\u003e`DotNetPublishAndExecRunner`, `publish`: Use 'dotnet publish' and 'dotnet exec'.\u003c/li\u003e\u003c/ul\u003e|\n|DOTNET_SAIL_CONFIGURATION|`-c`, `--configuration`|The configuration to run for.|\n|DOTNET_SAIL_LAUNCH_PROFILE|`--launch-profile`|The name of the launch profile to use when launching the application. This option is available with 'dotnet run' (DotNetRunRunner).|\n|DOTNET_SAIL_NO_LAUNCH_PROFILE|`--no-launch-profile`|Do not attempt to use launchSettings.json to configure the application. This option is available with 'dotnet run' (DotNetRunRunner).|\n|DOTNET_SAIL_EXEC_NAME|`--exec-name`|The name of the entrypoint assembly. This option is available with 'dotnet publish' and 'dotnet exec' (DotNetPublishAndExecRunner).|\n|DOTNET_SAIL_SDK|`--sdk`|The SDK to run for single C# source project. The default is 'Microsoft.NET.Sdk'.|\n|DOTNET_SAIL_TARGET_FRAMEWORK|`--target-framework`|The target framework to run for single C# source project. The default is 'net8.0'.|\n|DOTNET_SAIL_ENV_*|`-e`, `--env`|The environment variables for the application to be run.|\n\n```\ndocker run --rm -it mayuki/dotnet-sail -e DOTNET_ENVIRONMENT=Production -r publish https://example.com/repo.git arg1 arg2\n```\n\nIt is also possible to pass settings through environment variables of the container.\n```\ndocker run --rm -it -e DOTNET_SAIL_ENV_DOTNET_ENVIRONMENT=Production \\\n                    -e DOTNET_SAIL_SOURCE=https://example.com/repo.git \\\n                    -e DOTNET_SAIL_RUNNER=publish \\\n                    -e DOTNET_SAIL_ARGUMENTS=\"arg1 arg2\" \\\n                    mayuki/dotnet-sail\n```\n\n## Run in cloud services\n### Azure Container Instance\nIn ACI, containers can easily be launched by specifying the container image and setting environment variables. The screenshot below is an example of running a Blazor sample application.\n\n![](docs/images/screen-aci-01.png)\n![](docs/images/screen-aci-02.png)\n\n- Image source: Other registry\n- Image: mayuki/dotnet-sail\n- Environment variables:\n    - `DOTNET_URLS`: http://+:80\n    - `DOTNET_SAIL_SOURCE`: https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorSample_BlazorWebApp\n    - `DOTNET_SAIL_RUNNER`: publish\n\n## License\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayuki%2Fdotnet-sail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayuki%2Fdotnet-sail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayuki%2Fdotnet-sail/lists"}