dotnet docker / bin / sh:1:[dotnet ,:找不到 [英] dotnet docker /bin/sh: 1: [dotnet,: not found

查看:195
本文介绍了dotnet docker / bin / sh:1:[dotnet ,:找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用dockerfile成功构建,但是当我尝试从构建映像运行新容器时,出现以下错误:

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

我该怎么办解决方案?


错误:/ bin / sh:1:[dotnet ,:找不到

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



docker运行命令:



docker run command:

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



Dockerfile:



Dockerfile:

FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
ENV ASPNETCORE_URLS http://*:80
EXPOSE 80
COPY ./publish/myapp .
ENTRYPOINT ["dotnet", "myapp.dll"]


推荐答案

问题是Docker忽略文件不允许复制地址

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

我通过将地址添加到docker忽略文件或使用允许的文件地址

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

旧dockerignore配置

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

新的dockerignore配置

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

这篇关于dotnet docker / bin / sh:1:[dotnet ,:找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆