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

How to run python3 from within a docker container running on a Synology NAS? #235

Open
ghost opened this issue Mar 4, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2022

I have used Docker to install PiHole with its own IP-address on a Synology NAS. I have tried to install your whitelist through SSH but are facing problems. I have python3 but not inside the docker container. I have tried to find a solution on how to call it from within the container but with no success.

SSH into docker

Svettballe@Moln:$ sudo docker ps -q
Password:
71772e7cb0d9
Svettballe@Moln:
$ sudo docker exec -it 71772e7cb0d9 bash
root@Pihole-MacvlanNetwork:/# git clone https://github.com/anudeepND/whitelist.git
Cloning into 'whitelist'...
remote: Enumerating objects: 1058, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 1058 (delta 7), reused 1 (delta 0), pack-reused 1041
Receiving objects: 100% (1058/1058), 661.32 KiB | 3.74 MiB/s, done.
Resolving deltas: 100% (570/570), done.
root@Pihole-MacvlanNetwork:/# cd whitelist/scripts
root@Pihole-MacvlanNetwork:/whitelist/scripts# ls
domains.sql referral.sh uninstall.py whitelist.py
root@Pihole-MacvlanNetwork:/whitelist/scripts# sudo python3 whitelist/scripts/whitelist.py
sudo: python3: command not found

Python exists outside container

Svettballe@Moln:/$ python3
Python 3.8.8 (default, Jun 2 2021, 08:52:25)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

How did you manage to run “sudo python3 whitelist/scripts/whitelist.py
“ when inside PiHole container in docker?

Some step that is too obvious to mention for a programmer must be missing in the instructions, and I as a beginner cant figure it out.

@redbeardj
Copy link

Did you ever figure this out? I'm having the same issue.

@qquppsala
Copy link

I'm having the same issue.

@redbeardj
Copy link

Anyone figure out a solution? I've tried a couple discord servers and noone seems to have an answer. It's either something extremely simple or it just doesn't work on synology for some reason.

@ghost
Copy link
Author

ghost commented Apr 22, 2022

Did you ever figure this out? I'm having the same issue.

No I did not figure this out, running PiHole without Whitelist until someone tells me how to.

@michealespinola
Copy link

michealespinola commented Nov 10, 2022

You don't do any of this from inside the docker container. Your pihole should have container paths that are mounted to the local volume. These paths contain the databases that the whitelist adds itself into. You run the python command natively from your Synology terminal.

Here's an example of how I run the script on my system:

python3 /volume1/<...>/whitelist.py --dir /volume1/docker/pihole/pihole --docker

Its as easy as that. This is possible because I created my pihole container with the following docker run options:

--volume /volume1/docker/pihole/pihole:/etc/pihole \
--volume /volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d \

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

3 participants