pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.58k stars 1.13k forks source link

Error while trying to run the container #405

Closed TylerWolfDev closed 2 years ago

TylerWolfDev commented 5 years ago

This is a...

Description

I am running the below code docker run pihole/pihole -e ServerIP=(myserveriphere)

I am getting the error below:

ERROR: To function correctly you must pass an environment variables of 'ServerIP' into the docker container with the IP of your docker host from which you are passing web (80) and dns (53) ports from

Expected Behavior

Pi-hole should run.

Actual Behavior

Error

Your Environment

DL6ER commented 5 years ago

See https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh for details concerning the required parameters.

TylerWolfDev commented 5 years ago

See https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh for details concerning the required parameters.

I am still confused on where I would do that. I cannot find a folder to make changes on windows.

TylerWolfDev commented 5 years ago

@DL6ER How do I set the variables it is asking for.

TylerWolfDev commented 5 years ago

I have tried docker run pihole/pihole -e ServerIP=96.234.78.7 -p 80:80``-p 53:53/tcp -p 53:53/udp No luck same error

DL6ER commented 5 years ago

My understanding is that you should download the file https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh and modify it as you may need it. Instead of running any bulky docker run ... command directly, you should use the script which does the job for you.

dschaper commented 5 years ago

Everything after the name of the image is passed into the image as extra data. You need to put the image as the last item in your command line.

docker run -e ServerIP=96.234.78.7 -p 80:80 -p 53:53/tcp -p 53:53/udp pihole/pihole

TylerWolfDev commented 5 years ago

docker run -e ServerIP=96.234.78.7 -p 80:80 -p 53:53/tcp -p 53:53/udp pihole/pihole

@dschaper I am now getting the following Stopping pihole-FTL kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] Is this normal, if so what should I do next?

dschaper commented 5 years ago

What tag are you using of the pihole/pihole image?

TylerWolfDev commented 5 years ago

What tag are you using of the pihole/pihole image?

What do you mean by that?

TylerWolfDev commented 5 years ago

I used the pull command docker pull pihole/pihole

dschaper commented 5 years ago

My example command line is not the full command line that you would use to invoke, it was just an example of what format the command line is structured in. You're missing things like the DNS overrides and linking to the local network so that DHCP works.

Have a read through the main README.md on the repository and note the required command line contents.

TylerWolfDev commented 5 years ago

My example command line is not the full command line that you would use to invoke, it was just an example of what format the command line is structured in. You're missing things like the DNS overrides and linking to the local network so that DHCP works.

Have a read through the main README.md on the repository and note the required command line contents.

@dschaper I added the only other required content and got the following error:

Error response from daemon: driver failed programming external connectivity on endpoint jolly_euclid (b01ef11bc6323c2e8cb9b146e6b501f7702a3e38dbff60a76e1594062e83d7af): Bind for 0.0.0.0:80 failed: port is already allocated.

dschaper commented 5 years ago

That's a docker error. It appears that you have an existing container that has bound to that address. You'll need to stop any other containers that use the same port, or set the Pi-hole's external web port to something other than 80.

The Pi-hole docker image is rather complex and has some requirements that are special because of the daemon inside. You may need to gain a little more experience with docker before being able to easily run this Pi-hole image.

TylerWolfDev commented 5 years ago

That's a docker error. It appears that you have an existing container that has bound to that address. You'll need to stop any other containers that use the same port, or set the Pi-hole's external web port to something other than 80.

The Pi-hole docker image is rather complex and has some requirements that are special because of the daemon inside. You may need to gain a little more experience with docker before being able to easily run this Pi-hole image.

@dschaper I was able to fix this error and ran the following command: docker run -e ServerIP=96.234.78.7 -p 80:80 -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN pihole/pihole

It says that it worked but when I go to the below link I see ads. I cannot go to the domain pi.hole

https://pi-hole.net/pages-to-test-ad-blocking-performance/

Now I get WARNING: Localhost DNS setting (--dns=127.0.0.1) may fail in containers. docker: Error response from daemon: driver failed programming external connectivity on endpoint affectionate_khorana (8cdd36a10a74e339539fb5d0e6585cfd4dbc6112f93a9d00412867f70ac0d01c): Bind for 0.0.0.0:80 failed: port is already allocated.

after adding dns command.

dschaper commented 5 years ago

You need to set the network mode to host for that.

dschaper commented 5 years ago

You mentioned that you are using Windows, is the docker host on that same Windows computer and did you set it up to use linux containers or Windows containers?

TylerWolfDev commented 5 years ago

You mentioned that you are using Windows, is the docker host on that same Windows computer and did you set it up to use linux containers or Windows containers?

Yes, same Windows Computer and I currently have linux containers. Is that an issue?

dschaper commented 5 years ago

I don't believe this will work with a Windows docker engine. The network stack I don't think is compatible, but @diginc would know better on that than I.

TylerWolfDev commented 5 years ago

@dschaper I believe I have seen people run it on Windows docker engine before.

TylerWolfDev commented 5 years ago

@dschaper Do you know of another way to run Pi-hole on Windows 10 without requiring a linux vm?

dschaper commented 5 years ago

No, I don't. It's too tied in to the tcp/ip networking stack with linux applications to be able to take control of the Windows IP stack.

TylerWolfDev commented 5 years ago

@dschaper I found this video that shows it being ran on Windows but not showing how.

https://www.youtube.com/watch?v=5y2IIxrQJz4

mr-bolle commented 5 years ago

Hi @TylerWolfDev please try follow command.

docker run -e ServerIP=96.234.78.7 -p 81:80 -p 53:53/tcp -p 53:53/udp -e --dns=127.0.0.1 --dns=1.1.1.1 --cap-add=NET_ADMIN pihole/pihole

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.