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

Create upgrade / update / backup guide #7

Open
geerlingguy opened this issue May 17, 2021 · 5 comments
Open

Create upgrade / update / backup guide #7

geerlingguy opened this issue May 17, 2021 · 5 comments
Labels

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented May 17, 2021

Since it may be non-obvious for those new to Docker.

Basically, the easiest way is to go into each directory in the home folder (in this example, Pi-hole), and pull the images using docker-compose, then restart so it's running the latest image:

# Pi-hole update example
cd ~/pi-hole
docker-compose pull  # pulls the latest images inside the compose file
docker-compose up -d --no-deps  # restarts necessary containers with newer images
docker system prune --all  # deletes unused container images

You would need to do that manually inside each of the associated docker-compose-containing directories from time to time.

It might be good to do the following so this can be somewhat automated:

  1. Create a separate playbook or task file that backs up all the relevant configurations/Docker volumes (most notably, pi-hole).
  2. Create a playbook that upgrades all images (doing the above, but in each managed directory).
  3. Add documentation on how to run the playbook (and recover from backup in case of failure).

Maybe don't do the system prune by default in case someone does need to quickly recover back to an older image with a backup restore.

@geerlingguy
Copy link
Owner Author

geerlingguy commented May 17, 2021

For backup for Pi-hole at least, in the GUI you can go to Settings > Teleporter and click 'Backup'. To automate it through the console, you can run pihole -a -t (can I integrate it with something like my geerlingguy.backup role?).

If I run docker-compose exec pihole /bin/bash pihole -a -t it exports a file inside the container. docker-compose cp is not a supported command yet (see docker/compose#3593), so will have to figure out the best way of scripting this... maybe something like:

  1. Create a /backup directory inside the container (mkdir -p /backup).
  2. Run the pihole -a -t command inside the /backup directory.
  3. Cat the contents of /backup/[latest-file-with-extension].tar.gz and pipe them to file on host.
  4. Delete contents of /backup directory (rm -rf /backup/*).

It would be convenient for the pihole -a -t command to have an option to output the archive to shell instead of into a file, that would save the whole file-based annoying process.

@emilsahakyan
Copy link

Hi,
a question about the prometheus image - a specific version of the images is pulled (prom/prometheus:v2.25.2) in the internet-monitoring/docker-compose.yml. Is there any reason for that, any issue to not use prometheus:latest ?

@geerlingguy
Copy link
Owner Author

@emamajan - Honestly I don't remember if that was a change I made or I inherited from the original internet-monitoring code I forked... one thing to note is that of all the services that make up this playbook, prometheus and grafana are the two with the fastest development velocity and most prone to breaking with a version bump, so using latest means a little more maintenance to keep the configs in sync.

@emilsahakyan
Copy link

@geerlingguy - thanks for the clarification. Yes it will require more maintenance work, I agreed, but I was thinking about the update process and I believe the docker-compose pull will not update to newer images if a specific image version is used, so I switched to the latest version and it works fine (at least now).

@geerlingguy
Copy link
Owner Author

Added the simple update guide for Pi-hole to the README. Also see #188 which can help automate the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants