9

I am getting the below error while creating a python3 container in manjaro VMware:

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.

(exit status 1))`

i cannot understand what is the problem?

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"]
mgarciaisaia
  • 14,521
  • 8
  • 57
  • 81
M. Asif
  • 113
  • 1
  • 1
  • 8

2 Answers2

8

For clarity, the answer that worked for me from the thread linked in the comment section is:

# 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

Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
3

I bumped into this recently. The firewall wasn't running as the error suggested.

The solution:

systemctl start firewalld

After restarting the firewall, was able to raise the container up normally without error.

Might not be the only cause of this error, but the firewall being down produced this error in my case using Ubuntu 20.04 LTS (ARM64).

F1Linux
  • 3,580
  • 3
  • 25
  • 24