i’m trying to compose the .net core 5.0 and Sql server. i’m getting the below error
Attaching to webapisqlserver_code_1, webapisqlserver_api_1
api_1 | Could not execute because the specified command or file was not found.
api_1 | Possible reasons for this include:
api_1 |
**** You misspelled a built-in dotnet command.***
api_1 | * You intended to execute a .NET program, but dotnet-WebApiSQLServer.dll does not exist.
api_1 | * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
****
here is my docker compose file
version: ‘3.8’
services:
code:
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Password2020"
MSSQL_PID: Express
ports:
- "1433:1433"
api:
build: .
depends_on:
- code
environment:
ServerName: "ms-sql-demo"
Database: "WebAPISQLServer"
UserName: "SA"
Password: "Password2020"
ports:
- "8080:80"
docker file
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env WORKDIR /app # Copy csproj and restore as distinct layers COPY *.csproj ./ RUN dotnet restore # Copy everything else and build COPY . ./ RUN dotnet publish -c Release -o out # Build runtime image FROM mcr.microsoft.com/dotnet/sdk:5.0 WORKDIR /app EXPOSE 80 COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "WebApiSQLServer.dll"]