Docker: "driver failed programming external connectivity on endpoint testcontainer"
Asked Answered
A

2

11

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"]
Asymptomatic answered 7/8, 2018 at 20:3 Comment(2)
Try here: github.com/moby/moby/issues/16816 Look towards the bottom. They describe a couple of items that solved the issues for others.Anaclitic
@Anaclitic it's started working after restartAsymptomatic
E
13

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

Edsel answered 28/9, 2021 at 13:35 Comment(1)
You need to add sudo to all the three commands, not just for the firstUnwatched
C
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).

Criminate answered 25/11, 2021 at 9:39 Comment(1)
This worked for me but using systemctl start iptables.Tritheism

© 2022 - 2024 — McMap. All rights reserved.