1. 创建web api项目,编译并测试成功 2. 在项目的根目录添加Dockerfile文件,注意:Dockerfile文件名区分大小写 文件内容如下 # 基于microsoft/dotnet:latest构建Docker ImageFROM microsoft/dotnet:latest# Set the Working Directory 创建WebAPI目录WORKDIR ./app# Configure the listening port to 5006,对外暴露的端口应与程序中设置
docker发布遇到的两个问题 1:Could not resolve CoreCLR path. For more details, enable tracing by setting COREHOST_TRACE environment variable to 1 2:Error:An assembly specified in the application dependencies manifest(****.deps.json) was not package:'runtimepack
1.使用VS 2015 新建了一个Core API项目,然后把他的依赖升级到最新(我机器VS 2015默认的包都是rc版本),然后publish. 2.在publish目录的同级目录下,新建Dockerfile,没有后缀,里面内容如下: FROM microsoft/dotnet:latest WORKDIR /root # Copy the app COPY PublishOutput /root/ # Configure the listening port to #ENV ASPNETCO