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 80
#ENV ASPNETCORE_URLS http://*:9100
EXPOSE 9100/tcp

# Start the app
ENTRYPOINT dotnet JaxApi.dll

3.copy 文件到linux服务器,我这里使用PSCP工具,命令:pscp -r D:\Core\JaxApi\src\JaxApi\bin\Release root@*.16.2*.1*:/usr/jax/webtest,我这里把整个Release copy了上去

4.执行以下语句来生成一个image docker build -t jb91 Release/

5.没有问题的话,直接运行image docker run -it -p 9100:9100 jb91

 

相关文章:

  • 2022-02-11
  • 2020-01-11
  • 2022-12-23
  • 2018-09-04
  • 2021-06-28
  • 2021-06-22
  • 2021-09-02
猜你喜欢
  • 2021-08-29
  • 2021-10-29
  • 2022-02-03
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案