【发布时间】:2016-05-23 08:56:19
【问题描述】:
我使用 .net core 创建了一个 web api 应用程序,我想使用 docker 部署到 linux。怎么办?
我在“命令”部分的 project.json 中添加了这个(--server.urls), 所以它变成了这样:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server.urls http://0.0.0.0:5000",
},
这是我的 dockerfile
FROM microsoft/aspnet:1.0.0-rc1-update1-coreclr
COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
EXPOSE 5000/tcp
ENTRYPOINT ["dnx", "-p", "project.json", "web"]
我可以成功创建一个 docker 镜像,使用这个命令 docker build -t myapp .
但是当我运行 docker 时
docker run -d -t -p 80:5000 myapp,它抛出了一个错误
"Error response from daemon: driver failed programming external connectivity on endpoint kickass_hopper (16d5675978b188131670f391614f7f89b6ec977ae88924ae422a9a9c18768f22): iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 80 -j DNAT --to-destination 172.17.0.2:5000 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)."
有人知道发生了什么吗?
【问题讨论】:
-
这个讨论可能对你有用:No DOCKER chain in iptables
标签: .net linux docker asp.net-core .net-core