There is ethereum node runing in docker with command:
sudo docker run -d --restart=always --name ethereum \ -p 8545:8545 \ -p 30303:30303 \ ethereum/client-go \ --rpc --rpcaddr "0.0.0.0" --syncmode light --rpcapi eth,personal
with the option rpcaddr "0.0.0.0", the host machine can access ethereum node, but other machine with external ip also can.
How to deny external machine?
I know it can be done with iptables or some firewall.
Can it be done with docker itself?