I tried to use ufw
and iptables
in docker container.
However, I got this errors
iptables v1.6.1: can't initialize iptables table `filter': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
I figured out that I can access with --privileged
command with docker exec
.
docker exec -it --privileged my_container_id bash
root@my_container_id:/$ sudo ufw status
Status: inactive
Also, I can use --cap-add=NET_ADMIN
when run container.
You can see more detail about capability here(docker docs)
docker run --cap-add=NET_ADMIN ...
'backend > docker' 카테고리의 다른 글
docker: CMD와 ENTRYPOINT 다른점 (0) | 2020.12.05 |
---|---|
Docker : connect to ruuning container by using ssh (0) | 2018.10.10 |
Docker : pg_dump from docker container (0) | 2018.05.15 |
ubuntu 16.04에 docker-compose 설치하기 (0) | 2018.02.07 |
ubuntu 16.04에 docker-ce (Community Edition) 설치하기 (0) | 2018.02.02 |