Farrukh Faizy
Farrukh Faizy

Reputation: 1235

Unable to execute the RUN command in Docker

I am unable to execute the docker RUN command and it shows me everytime the yellow highlighted line, I am basically creating a volume in a container.

I have installed everything as well to run this. Currently running linux container on windows.

++UPDATE: Here is the docker file

enter image description here

CMD:

t

Upvotes: 0

Views: 67

Answers (1)

Kārlis Ābele
Kārlis Ābele

Reputation: 1021

As far as I know the good practice is to define the single executable (in this case dotnet) as entry point and then provide the rest as part of the CMD definition...

In your case you should try making these changes in your Dockerfile

ENTRYPOINT ["dotnet"]

CMD ["app/myapp.dll"]

And also you might consider simply copying the app directory to /app and then you wouldn't need the app/myapp.ddl (as now you are changing WORKDIR to /app and then copying the app to app/ which in essence creates a /app/app folder)

I'd say your Dockerfile should look something like this

FROM mcr.microsoft.com/dotnet/core/runtime:2.2

COPY app/bin/Release/netcoreapp2.2/publish/app /app

WORKDIR /app

ENTRYPOINT ["dotnet"]

CMD ["myapp.dll"]

Upvotes: 1

Related Questions