CyberDNS / Lupusec2Mqtt

Lupusec Alarm System to Mqtt
MIT License
11 stars 6 forks source link

Docker build does not work #56

Closed SuPuL closed 1 year ago

SuPuL commented 1 year ago

Hi, i tried to create a docker image with the provided file. But I get a path problem. I tried running it

{gitroot}/src/docker build Lupusec2Mqtt and {gitroot}/src/Lupusec2Mqtt/docker build .

I'm always get this error: => ERROR [build 3/7] COPY [Lupusec2Mqtt/Lupusec2Mqtt.csproj, Lupusec2Mqtt/]

So I tried to change the path to COPY ["Lupusec2Mqtt.csproj", "Lupusec2Mqtt/"]

This seems to work but I get a problem from the dotnet restore command later on

=> ERROR [build 7/7] RUN dotnet build "Lupusec2Mqtt.csproj" -c Release -o /app/build                             1.9s
------                                                                                                                 
 > [build 7/7] RUN dotnet build "Lupusec2Mqtt.csproj" -c Release -o /app/build:                                        
#15 0.243 MSBuild version 17.3.2+561848881 for .NET                                                                    
#15 0.567   Determining projects to restore...
#15 0.757   All projects are up-to-date for restore.
#15 1.835 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/Lupusec2Mqtt/Lupusec2Mqtt.csproj]
#15 1.843 
#15 1.843 Build FAILED.
#15 1.843 
#15 1.843 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/Lupusec2Mqtt/Lupusec2Mqtt.csproj]
#15 1.843     0 Warning(s)
#15 1.843     1 Error(s)
#15 1.844 
#15 1.844 Time Elapsed 00:00:01.54
------
executor failed running [/bin/sh -c dotnet build "Lupusec2Mqtt.csproj" -c Release -o /app/build]: exit code: 1

Do you have any idea what is wrong here?

SuPuL commented 1 year ago

Seems that the docker files needs to be placed in the src folder instead of the src/Lupusec2Mqtt folder. Do this the main is found.