Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnet docker /bin/sh: 1: [dotnet,: not found

I build successfully with dockerfile, but when I try to run a new container from the build image, I get the following error:

What do i have to do for the solution?

Error : /bin/sh: 1: [dotnet,: not found

docker run command:

docker run --rm -it -p 8080:80 furkaandogan/myapp:0.1

Dockerfile:

FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
ENV ASPNETCORE_URLS http://*:80
EXPOSE 80
COPY ./publish/myapp .
ENTRYPOINT ["dotnet", "myapp.dll"]
like image 869
Muhammet Furkan DOĞAN Avatar asked May 19 '17 19:05

Muhammet Furkan DOĞAN


3 Answers

I faced similar issue. In my case the problem was in the entry point statement in Dockerfile. I was missing a comma between two parameters "dotnet" and "url for dll".

Before:

CMD ["dotnet" "url to dll"]

After fix applied:

CMD ["dotnet", "url for dll"]
like image 51
yvinap Avatar answered Oct 19 '22 01:10

yvinap


There is something on your entrypoint line of the Dockerfile to trigger docker into seeing it as invalid json and it's falling back to shell execution of the string instead. It looks correct in what you pasted, so I'd check for characters like smart quotes or perhaps a Windows newline at the end of the string.

like image 27
BMitch Avatar answered Oct 19 '22 00:10

BMitch


The problem is that the docker ignore file does not allow the copy address

I solved the problem by adding the address to the docker ignore file or using the allowed file address

Old dockerignore config

*
!obj/Docker/publish/*
!obj/Docker/empty/

new dockerignore config

  *
    !obj/Docker/publish/*
    !obj/Docker/empty/
    !publish/myapp
like image 1
Muhammet Furkan DOĞAN Avatar answered Oct 19 '22 01:10

Muhammet Furkan DOĞAN