https://github.com/ymasaoka/docker-dotnetcore
Provides docker-compose.yaml to launch a Docker container for .NET Core.
https://github.com/ymasaoka/docker-dotnetcore
asp-net-core docker docker-compose docker-dotnetcore dotnet dotnet-core dotnetcore
Last synced: 3 months ago
JSON representation
Provides docker-compose.yaml to launch a Docker container for .NET Core.
- Host: GitHub
- URL: https://github.com/ymasaoka/docker-dotnetcore
- Owner: ymasaoka
- License: mit
- Created: 2020-08-26T20:00:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-28T13:52:57.000Z (about 4 years ago)
- Last Synced: 2025-01-19T08:15:10.038Z (over 1 year ago)
- Topics: asp-net-core, docker, docker-compose, docker-dotnetcore, dotnet, dotnet-core, dotnetcore
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-dotnetcore
Provides docker-compose.yaml to launch a Docker container for .NET Core.
# How to use
1. **Clone this repository** to a directory of your choice.
1. Move to the **docker-dotnetcore** directory.
1. Execute the following command to start the container.
```bash
docker-compose up -d
```
1. Run the following command to confirm that the container has started.
```bash
docker-compose ps
```
## Creating .NET Core project
Create a .NET Core project using the docker-compose command.
```bash
docker-compose run --rm app dotnet new console -o
```
For `dotnet new` command options like *console*, check [here](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new) or use `--help` option to check it.
You can also see other dotnet commands [here](https://docs.microsoft.com/en-us/dotnet/core/tools/).
```bash
docker-compose run --rm app dotnet new --help
```
## Execute .NET Core Project
The following command is an example of creating and executing a console application that displays `Hello World!` by using docker-compose command.
```bash
docker-compose run --rm app dotnet new console -o MyFirstProject
docker-compose run -w /usr/src/MyFirstProject --rm app dotnet run
```
The `-w` option specifies the directory in which to run the command inside the container.
# Related Repos
The repository specified by `image` in docker-compose.yaml can be changed depending on the usage.
See the links below for more information.
- .NET Core 2.1/3.1
- [dotnet/core/sdk](https://hub.docker.com/_/microsoft-dotnet-core-sdk/): .NET Core SDK
- [dotnet/core/aspnet](https://hub.docker.com/_/microsoft-dotnet-core-aspnet/): ASP.NET Core Runtime
- [dotnet/core/runtime](https://hub.docker.com/_/microsoft-dotnet-core-runtime/): .NET Core Runtime
- [dotnet/core/runtime-deps](https://hub.docker.com/_/microsoft-dotnet-core-runtime-deps/): .NET Core Runtime Dependencies
- [dotnet/core/samples](https://hub.docker.com/_/microsoft-dotnet-core-samples/): .NET Core Samples
- .NET 5.0+
- [dotnet/sdk](https://hub.docker.com/_/microsoft-dotnet-sdk/): .NET SDK
- [dotnet/aspnet](https://hub.docker.com/_/microsoft-dotnet-aspnet/): ASP.NET Core Runtime
- [dotnet/runtime](https://hub.docker.com/_/microsoft-dotnet-runtime/): .NET Runtime
- [dotnet/runtime-deps](https://hub.docker.com/_/microsoft-dotnet-runtime-deps/): .NET Runtime Dependencies