Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6140

How to Restrict Docker Access to a Single IP Address [closed]

$
0
0

I am using Docker on a Linux server with Ubuntu as the operating system. I installed a specific package (devlikeapro/waha-plus) in Docker, which created a website that automates WhatsApp.

I want to restrict access to Docker to only one IP address, so that the entire internet cannot access this site. I want only my server to be able to access the API. How do I do this?

Currently, I am running the Docker container with the following command:

docker run -it --rm -p 3000:3000/tcp --name waha devlikeapro/waha-plus

I tried these things and they didn't work:

sudo ipset create allowed-ip hash:ip

sudo ipset add allowed-ip

sudo iptables -I DOCKER-USER -m set ! --match-set allowed-ip src -j DROP


sudo iptables -A INPUT -p all -s -j ACCEPT

sudo iptables -A INPUT -p all -j DROP


sudo iptables -F

sudo iptables -A INPUT -s -j ACCEPT

sudo iptables -A INPUT -j DROP

sudo iptables-save


Viewing all articles
Browse latest Browse all 6140

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>