pegasy / lancachenet_rpi

MIT License
2 stars 2 forks source link

What makes this work on RPi? #1

Open pheetr opened 5 years ago

pheetr commented 5 years ago

Hi @pegasy, the version you've pushed to Docker works on my RPi4 as well (awesome, btw!), so I was looking to understand what you've done to get the lancachenet stack work on ARM.

When looking at your build.sh it appears that you're not changing much of the underlying stuff, other than modifying proxy_max_temp_file_size in generic and map_hash_bucket_size in monolithic. Lancache-dns seems to be largely unchanged, yet your version works on RPi, while the LanCache team's doesn't.

I suspect the magic may happen in the sed lines, but I'm very much a Linux novice and don't have a good grasp on it yet. I figure you're probably mainly changing the Docker tags, but maybe there's more happening? Or is it working perhaps as you're performing the build directly on the RPi?

So yeah, if you have a bit of time I would appreciate if you could share some insight. :)

Cheers

pegasy commented 5 years ago

It's mostly building it on the RPi thats the difference, the docker images that lancachenet/* provide are not built for arm.

sed -e "s/lancachenet\\/$s/pegasy\\/lancachenet_$s/g" -i Dockerfile this only replaces the FROM lancachenet/generic:latest to FROM pegasy/generic:latest in each of the "stages".

sed -e "s/proxy_max_temp_file_size 40960m;/proxy_max_temp_file_size 1920m;/g" -i overlay/etc/nginx/sites-available/generic.conf.d/root/20_cache.conf changes the proxy_max_temp_file_size from 40960m to 1920m, since it seems that's the limit for a 32bit os, so on 64 bit raspbian / ubuntu on a RPi it wouldn't be needed to change this setting I think, once I have some more time to tinker (or get another RPi4) I will try installing a 64 bit os instead and try it out.