<commit_before>---
description: Create a Docker Compose application using ASP.NET Core and SQL Server on Linux in Docker. 
keywords: docker, dockerize, dockerizing, dotnet, .NET, Core, article, example, platform, installation, containers, images, image, dockerfile, build, ASP.NET Core, SQL Server, mssql
title: "Quickstart: Compose and ASP.NET Core with SQL Server"
---

This quick-start guide demonstrates how to use Docker Compose to set up and run the sample ASP.NET Core application using the [ASP.NET Core Build image](https://hub.docker.com/r/microsoft/aspnetcore-build/) with the [SQL Server on Linux image](https://hub.docker.com/r/microsoft/mssql-server-linux/). You just need to have [Docker Engine](https://docs.docker.com/engine/installation/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your platform of choice.

For this sample, we will create a sample `dotnet core web application` using the `aspnetcore-build` Docker image. After that, we will create a `Dockerfile`, configure this app to use our SQL Server database and then create a `docker-compose.yml` that will define the behavior of all of these components.

# Create the Docker Compose application

1. Create an empty directory named `/app` under the root and navigate into it.

    This directory will be the context of your docker-compose project. For [Docker for Windows](https://docs.docker.com/docker-for-windows/#/shared-drives) and [Docker for Mac](https://docs.docker.com/docker-for-mac/#/file-sharing), you have to set up file sharing for the volume that you need to map. 

1. Within your directory, use the `aspnetcore-build` Docker image to generate a sample web application within the container and into your host machine under `/app`:

    ```bash
    docker run -v /app:/app microsoft/aspnetcore-build:lts /bin/bash -c "cd app && dotnet new -t web"
    ``` 

    >**Note**: If running in Docker for Windows, make sure to add the necessary `C:/` prefix to the host mapped folder.

1. Create a `Dockerfile` within the `/app` directory and add the following content:
<commit_msg>Updating keywords<commit_after>---
description: Create a Docker Compose application using ASP.NET Core and SQL Server on Linux in Docker. 
keywords: dotnet, .NET, Core, example, ASP.NET Core, SQL Server, mssql
title: "Quickstart: Compose and ASP.NET Core with SQL Server"
---

This quick-start guide demonstrates how to use Docker Compose to set up and run the sample ASP.NET Core application using the [ASP.NET Core Build image](https://hub.docker.com/r/microsoft/aspnetcore-build/) with the [SQL Server on Linux image](https://hub.docker.com/r/microsoft/mssql-server-linux/). You just need to have [Docker Engine](https://docs.docker.com/engine/installation/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your platform of choice.

For this sample, we will create a sample `dotnet core web application` using the `aspnetcore-build` Docker image. After that, we will create a `Dockerfile`, configure this app to use our SQL Server database and then create a `docker-compose.yml` that will define the behavior of all of these components.

# Create the Docker Compose application

1. Create an empty directory named `/app` under the root and navigate into it.

    This directory will be the context of your docker-compose project. For [Docker for Windows](https://docs.docker.com/docker-for-windows/#/shared-drives) and [Docker for Mac](https://docs.docker.com/docker-for-mac/#/file-sharing), you have to set up file sharing for the volume that you need to map. 

1. Within your directory, use the `aspnetcore-build` Docker image to generate a sample web application within the container and into your host machine under `/app`:

    ```bash
    docker run -v /app:/app microsoft/aspnetcore-build:lts /bin/bash -c "cd app && dotnet new -t web"
    ``` 

    >**Note**: If running in Docker for Windows, make sure to add the necessary `C:/` prefix to the host mapped folder.

1. Create a `Dockerfile` within the `/app` directory and add the following content:

{'fraction_non_alphanumeric': 0.09620563035495716, 'fraction_numerical': 0.0014687882496940024, 'mean_word_length': 4.178707224334601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '221620', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1101, 'n_words': 524}