Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have to recreate ufw rules after docker restart #110

Open
ahushh opened this issue Sep 18, 2023 · 1 comment
Open

Have to recreate ufw rules after docker restart #110

ahushh opened this issue Sep 18, 2023 · 1 comment

Comments

@ahushh
Copy link

ahushh commented Sep 18, 2023

Thank you for this tool! Very useful and easy to use, but I there's one tiny problem.
I have opened 80 and 443 ports for my container:

sudo ufw-docker allow backend_nginx_1 80
sudo ufw-docker allow backend_nginx_1 443

But after I restart the containers with docker-compose down && docker-compose up -d, allowed ports seems not to be working, until I run ufw-docker allow again. But I can't do this inside github actions workflow because ufw requires root access. Is there a way to allow ports permanently? Or somehow automatize recreating ufw rules after containers restart? Why this problem even happen? After all I specify container name, not container id, and the rules looks the same after recreating.

Thank you for any assistance.

@chaifeng
Copy link
Owner

Because the container IP address may change after recreating the containers.

related to this issue #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants