autorestic icon indicating copy to clipboard operation
autorestic copied to clipboard

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

Open Natanel-Shitrit opened this issue 7 months ago • 2 comments

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:

  • Resolves #334

Natanel-Shitrit avatar Nov 18 '23 22:11 Natanel-Shitrit

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

vercel[bot] avatar Nov 18 '23 22:11 vercel[bot]

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

Natanel-Shitrit avatar Nov 18 '23 22:11 Natanel-Shitrit

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

cupcakearmy avatar Feb 15 '24 13:02 cupcakearmy