Ryukote
Ryukote

Reputation: 794

Docker - dotnet - can't run app from entrypoint

I have weird problems with entrypoint in my dockerfile.

This is my dockerfile:

FROM microsoft/dotnet:latest

WORKDIR /test

ADD . /test

RUN ["dotnet", "restore", "DockerAPI2.sln"]
RUN ["dotnet", "build", "DockerAPI2.sln"]

EXPOSE 4000/tcp

ENTRYPOINT [ "dotnet", "DockerAPI2.dll" ]

When I run docker run --name test -d -p 4001:4000 -v "C:\Users\random\docker":"/var/lib" -t test-img:latest I get next error:

No executable found matching command "dotnet-DockerAPI2.dll

What I noticed is that for some xy reason, he is placing "-" between dotnet and DockerAPI2.dll which is ofc not valid. I would like to know if this is a bug or there is some way to get around this?

PS: I am running Docker for Windows with Linux containers, and I have enabled 4001 in firewall.

Upvotes: 1

Views: 2093

Answers (2)

Meir Kriheli
Meir Kriheli

Reputation: 81

You can try build -o /test This shall redirect the output directory.

Upvotes: 0

Ryukote
Ryukote

Reputation: 794

The answer is pretty simple. I was looking in the directory of WORKDIR which is

/test

, but I needed to look into path where actual dll is, and that is

/test/DockerAPI2/bin/Debug/netcoreapp2.0/

Upvotes: 1

Related Questions