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

feat: add the ability to backup docker volumes from docker container #339

Merged

Conversation

Natanel-Shitrit
Copy link
Contributor

Background

When building my autorestic backup I wanted to avoid installing autorestic locally - this is because I want to avoid manual setups in case I move to a new host.

Problem

I wanted to backup my docker volumes from inside the autorestic docker container.
It was not possible with the stock image due to lack of the docker-cli package.

Changes

  • Added docker-cli package.

Example:

# docker-compose.yml
# docker compose run backup
version: "2.1"

services:
  backup:
    image: cupcakearmy/autorestic
    volumes:
      # Docker socket to backup volumes
      - /var/run/docker.sock:/var/run/docker.sock
      # AutoRestic config
      - ./.autorestic.yaml:/.autorestic.yaml
    # Run backup
    entrypoint: ["autorestic", "backup", "--ci", "-va", "-c", "/.autorestic.yaml"]
version: 2

global:
  # ...

locations:
  docker_volumes:
    from:
      - volume_example
    type: volume
    to: remote

backends:
  remote:
    # ...

Related Issues:

Copy link

vercel bot commented Nov 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
autorestic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 15, 2024 1:26pm

@Natanel-Shitrit
Copy link
Contributor Author

I can add an example to the docs if you are planning to merge this :)

@cupcakearmy
Copy link
Owner

Thanks, and sorry for being stale for so long. Docs are always welcomed :) I'll merge it.

@cupcakearmy cupcakearmy merged commit 4cc4431 into cupcakearmy:master Feb 15, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

Docker volume backup not working from within container
2 participants