lancachenet / monolithic

A monolithic lancache service capable of caching all CDNs in a single instance
https://hub.docker.com/r/lancachenet/monolithic
Other
728 stars 73 forks source link

Can't get it to work with podman #77

Closed nebula8830 closed 4 years ago

nebula8830 commented 4 years ago

Describe the issue you are having

Everything seems to be working fine based on logs, but DNS doesn't resolve anything.

How are you running the container(s)?

Running podman in Fedora 31 Server virtualised on another Fedora Server 31. Had to run this at first so containers could bind the ports. "sudo sysctl net.ipv4.ip_unprivileged_port_start=1"

podman run --restart=always --name lancache-dns --detach -p 10.0.4.2:53:53/udp -e USE_GENERIC_CACHE=true -e LANCACHE_IP="10.0.4.2" -e UPSTREAM_DNS="10.0.0.1" lancachenet/lancache-dns:latest
podman run --restart=always --name lancache --detach -v /cache/data:/data/cache -v /cache/logs:/data/logs -p 10.0.4.2:80:80 lancachenet/monolithic:latest
podman run --restart=always --name sniproxy --detach -p 10.0.4.2:443:443 lancachenet/sniproxy:latest

DNS Configuration

EdgeRouter-X DHCP server DNS1 set to "10.0.4.2" where containers are being run with ports binded. Upstream DNS set on containers to go back to router, which then has its own small cache, then goes to 8.8.8.8

Output of container(s)

podman logs lancache-dns

image

nebula8830 commented 4 years ago

I got the DNS issues resolved by opening the required ports in firewalld. But now I am having issues with lancache container constantly restarting with this error nginx: [emerg] mkdir() "/data/cache/cache" failed (13:Permission denied) I even did sudo chmod -r 777 /cache/ and still get the error and restarting repeatedly.

nebula8830 commented 4 years ago

Adding --privileged to the lancache container creation command made it work fine. I assume adding that to all would also fix the port binding issues. Without changing the net.ipv4.ip_unprivileged_port_start.

So to anyone trying to run in podman and/or a OS other than ubuntu, some tips.

  1. change commands from docker to podman
  2. change --restart until-stopped to --restart=always
  3. add --privileged to be able to bind ports and fix permission issue
  4. make sure firewall ports are open for required services