Docker:"驱动程序在端点测试容器上编程外部连接失败"



我在manjaro VMware:中创建python3容器时收到以下错误

docker: Error response from daemon: driver failed programming external connectivity on endpoint testcontainer (c55fc0dd481c36765fcd968118c3fbf5c7fa686cdfc625c485f963109b0f89e3):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 5000 -j DNAT --to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.

(退出状态1(`

我不明白问题出在哪里?

dockerfile:

FROM python:3.7-alpine
RUN adduser -D test`
WORKDIR /home/testapp`
ADD ./webapp/requirements.txt requirements.txt`
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt`
RUN pip3 install gunicorn
ADD ./webapp webapp/`
ENV FLASK_APP app.py
USER test
EXPOSE 5000
ENTRYPOINT ["./app.py"]

为了清楚起见,在注释部分链接的线程中对我有效的答案是:

# Enter below command, it will clear all chains.
$ sudo iptables -t filter -F
$ sudo iptables -t filter -X
# Then restart Docker Service using below comamnd
$ sudo systemctl restart docker

https://github.com/moby/moby/issues/16816#issuecomment-327074574

我最近遇到了这个问题。防火墙没有按照错误提示的方式运行。

解决方案:

systemctl start firewalld

重新启动防火墙后,能够正常提升容器,没有出现错误。

可能不是这个错误的唯一原因,但在我使用Ubuntu 20.04 LTS(ARM64(的情况下,防火墙关闭导致了这个错误。

相关内容

最新更新