chriscrowe / docker-pihole-unbound

Run Pi-Hole + Unbound on Docker
1.04k stars 270 forks source link

Setting up container #233

Open Wundo-1 opened 6 months ago

Wundo-1 commented 6 months ago

Hello! Im new to docker and linux and am trying to figure this out. For the file structure i am using /opt/container1 I Created a .yml file and a .env file. and when i spun up the container only pihole installed (working healthy) but "sudo service unbound restart" gives "service not found" and "Dig" gives "server not found" I suspect unbound wasnt installed into the container and im curious what i have done wrong or Havent done. I have the .yml file and .env file in /opt/container1 am i also supposed to create a "unbound-pihole.conf, unbound-run" files? if so, where do i place those?

dockercompose.txt

xteriormask4eva commented 6 months ago

Sorry if this is over explaining but I didnt know how much your knew...

Basically this set up is sort of like a bunch of containers running in coordination... some call it "container orchestration"... anyways not important. What is important is that your docker-compose.yaml file and your .env file.. All should NOT have file extensions and the dockercompose file should be docker-compose.yaml.

With that here's a step by step.

  1. Next time you login in use this command to navigate to your home directory: cd /. Think of it as your windows desktop
  2. Next type this command: git clone https://github.com/chriscrowe/docker-pihole-unbound.git should create the folder and clone this repo as is.
  3. Then once again we navigate into the directory we want to spin up the container in with: cd /docker-pihole-unbound/one-container if you're unsure what the name is you can use ls to see the files in the directory. Note that we went into two directories with that command
  4. Next we will copy your .env file into this directory --> /docker-pihole-unbound/one-container (if you're not sure how to do this ask away) and then once inside said folder be sure to make the necessary changes to your docker-compose.yaml file.
  5. Now that all changes have been made double check that you have all the variables... remove the ones you don't need from your .env file (if you aren't port forwarding)
  6. utter the magic words with your keyboard sudo docker compose up -d ... have fun...