Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of using iptables to report error can't initialize iptables table Permission denied in container

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to solve the problem of using iptables error report can't initialize iptables table Permission denied in the container. In view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Background

A micro service is deployed in the docker container that requires docker push to be mirrored to docker registry. Therefore, the docker service needs to be installed in the docker container. However, when starting the container, an error was reported:

Can't initialize iptables table `filter': Permission denied (you must be root) Perhaps iptables or your kernel needs to be upgraded. Reason

The docker service is deployed in the container, and the docker service uses iptables, so when you start the container, the iptables within the container is also started. However, iptables must work in the privileged mode of the container, otherwise it will be reported incorrectly.

Solution method

Add the corresponding privileged parameter when starting the container.

Launch container in docker docker run-privileged [imageName] Marathon launch container {... Instances: 1, container: {"type": "DOCKER", "volumes": [], "docker": {"image": "imageName", "network": "BRIDGE", "privileged": true, "parameters": [] }.} this is the answer to how to solve the problem of using iptables to report an error can't initialize iptables table Permission denied in the container. I hope the above content can help you to a certain extent, if you still have a lot of doubts to be solved, you can follow the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report