dotnet docker/bin/sh: 1: [dotnet,: not found [英] dotnet docker /bin/sh: 1: [dotnet,: not found
本文介绍了dotnet docker/bin/sh: 1: [dotnet,: not found的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 dockerfile 成功构建,但是当我尝试从构建映像运行新容器时,出现以下错误:
我需要为解决方案做什么?
<块引用>错误:/bin/sh: 1: [dotnet,: not found
docker 运行命令:
docker run --rm -it -p 8080:80 furkaandogan/myapp:0.1
Dockerfile:
来自 microsoft/aspnetcore:1.1ARG 源工作目录/应用程序ENV ASPNETCORE_URLS http://*:80曝光 80复制 ./publish/myapp .入口点 [dotnet",myapp.dll"]
解决方案
问题是docker ignore文件不允许复制地址
我通过将地址添加到 docker ignore 文件或使用允许的文件地址来解决问题
旧的 dockerignore 配置
<预><代码>*!obj/Docker/发布/*!obj/Docker/空/新的 dockerignore 配置
<代码> *!obj/Docker/发布/*!obj/Docker/空/!publish/myapp
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"]
解决方案
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
这篇关于dotnet docker/bin/sh: 1: [dotnet,: not found的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文