Here is my project file.
❯ ls ─╯
BosApp BosApp.sln Dockerfile README.md
Inside the BosApp we have
ApiException.cs ShareModel.cs
BosApp.csproj Startup.cs
Controllers UserNotAuthorizedException.cs
Data Views
Dockerfile appsettings.Development.json
ExceptionMiddlewareExtensions.cs appsettings.json
Migrations bin
Models libwkhtmltox.dll
Program.cs libwkhtmltox.dylib
Properties obj
RequestResponseLoggingMiddleware.cs robots.json
RequestResponseLoggingMiddlewareExtensions.cs web.config
Services wwwroot
My docker file
FROM microsoft/dotnet:latest
COPY . /app
WORKDIR /APP
RUN dotnet restore
RUN dotnet build
EXPOSE 5000/tcp
ENV ASPNETCORE_URLS http://*:5000
ENV ASPNETCORE_ENVIRONMENT docker
ENTRYPOINT dotnet run
In the terminal, inside the project structure where I have DockerFile, I am writing :
docker build -t bosapp-demo .
Output is this :
❯ docker build -t bosapp-demo . ─╯
Sending build context to Docker daemon 214.8MB
Step 1/9 : FROM microsoft/dotnet:latest
---> 56a634b88a04
Step 2/9 : COPY . /app
---> dec32085afa9
Step 3/9 : WORKDIR /APP
---> Running in 5575edfaab03
Removing intermediate container 5575edfaab03
---> 1bc0fb3179c0
Step 4/9 : RUN dotnet restore
---> Running in 1138521bd5e0
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
The command '/bin/sh -c dotnet restore' returned a non-zero code: 1
I am trying to create docker image first time and have that type of problem.
Any help and advice will be worth for me.
.dllfile in this case to copy.