Code Monkey home page Code Monkey logo

docker-autorestic's Introduction

Docker image based on the awesome cupcakearmy/autorestic.

Docker Image Version (tag latest semver) Docker Image Size (tag) Docker Pulls GitHub Tag Build Status License: MIT GitHub Last Commit Awesome Badges

Image

Registry Image
Docker Hub pascaliske/autorestic
GitHub ghcr.io/pascaliske/autorestic

The following platforms are available for this image:

$ docker run --rm mplatform/mquery pascaliske/autorestic:latest
Image: pascaliske/autorestic:latest
 * Manifest List: Yes
 * Supported platforms:
   - linux/amd64
   - linux/arm/v7
   - linux/arm64

Usage

To use this image pull it from one of the following registries:

# docker hub
docker pull pascaliske/autorestic

# github container registry
docker pull ghcr.io/pascaliske/autorestic

Create an initial config file (config.yml):

backends:
  my-backend:
    type: local
    path: /var/lib/autorestic/backends/my-backend
locations:
  my-location:
    from: /var/lib/autorestic/locations/my-location
    to:
      - my-backend
  my-volume:
    from: /var/lib/autorestic/locations/my-volume
    to:
      - my-backend

The following bind mounts are required:

Mount Description
/etc/autorestic/cache Your restic cache folder. Optional
/etc/autorestic/config.yml Your autorestic configuration file. Required
/var/lib/autorestic/locations All locations defined as from in the config file. Required
/var/lib/autorestic/backends All paths defined for backends with type: local in the config file. Required

Note: To backup volumes you can directly mount them in /var/lib/autorestic/locations and reference them as normal folder in the config file:

docker run --rm \
  -v my-volume:/var/lib/autorestic/locations/my-volume \
  ghcr.io/pascaliske/autorestic:latest backup --location my-volume

Run a backup with the required volume mounts:

$ docker run --rm \
    -v $(pwd)/config.yml:/etc/autorestic/config.yml \
    -v $(pwd)/cache:/etc/autorestic/cache \
    -v $(pwd)/my-backend:/var/lib/autorestic/backends/my-backend \
    -v $(pwd)/my-location:/var/lib/autorestic/locations/my-location \
    -v my-volume:/var/lib/autorestic/locations/my-volume \
    ghcr.io/pascaliske/autorestic:latest backup --location my-location

Restore a backup with the required volume mounts. The target folder should be bind mounted as well:

$ docker run --rm \
    -v $(pwd)/config.yml:/etc/autorestic/config.yml \
    -v $(pwd)/cache:/etc/autorestic/cache \
    -v $(pwd)/my-backend:/var/lib/autorestic/backends/my-backend \
    -v $(pwd)/my-location:/var/lib/autorestic/locations/my-location \
    -v my-volume:/var/lib/autorestic/locations/my-volume \
    -v $(pwd)/my-restore:/tmp/my-restore \
    ghcr.io/pascaliske/autorestic:latest restore --location my-location --from my-backend --to /tmp/my-restore

For a list of all commands and their usage visit the autorestic docs. An example usage can be found here.

License

MIT โ€“ ยฉ 2022 Pascal Iske

docker-autorestic's People

Contributors

cbrucks avatar dependabot[bot] avatar github-actions[bot] avatar pascaliske avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cbrucks igor-vovk

docker-autorestic's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

dockerfile
Dockerfile
  • golang 1.22-alpine
  • alpine 3.20
github-actions
.github/workflows/docs.yml
  • actions/checkout v4
  • arduino/setup-task v1
  • mhausenblas/mkdocs-deploy-gh-pages 1.26
.github/workflows/image.yml
  • actions/checkout v4
  • actions/setup-node v4.0.2
  • docker/setup-qemu-action v3
  • docker/metadata-action v5
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action v3
  • docker/build-push-action v6
  • ncipollo/release-action v1
  • actions/checkout v4
  • crazy-max/ghaction-container-scan v3
  • github/codeql-action v3
.github/workflows/labels.yml
  • actions/checkout v4
  • crazy-max/ghaction-github-labeler v5
npm
package.json
  • @commitlint/cli ^19.0.0
  • @commitlint/config-conventional ^19.0.0
  • @rstacruz/bump-cli ^2.0.1
  • husky ^9.0.10
  • standard-changelog ^6.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

How working with docker volumes? Got errors volume does not exists...

Many thanks for this nice software package you created!!

I currently test it with docker volumes, but get it not running as expected.

This is my ./config,yml:

version: 2
backends:
my-to-backend:
type: local
path: /var/lib/autorestic/backends/my-to-backend
locations:
my-from-location:
from:
- /var/lib/autorestic/locations/my-from-location
to:
- my-to-backend
my-from-volumes:
from:
- pgdata
type: volume
to:
- my-to-backend

This is the command i run:
docker run --rm -v ./config.yml:/etc/autorestic/config.yml -v ./cache:/etc/autorestic/cache -v ./backends/my-to-backend:/var/lib/autorestic/backends/my-to-backend pascaliske/autorestic:latest backup --location my-from-volumes

This is what i get:
Using config: /etc/autorestic/config.yml
Using lock: /etc/autorestic/.autorestic.lock.yml
Backing up location "my-from-volumes"
Backend: my-to-backend
volume "pgdata" does not exist
Error: 1 errors were found

But docker tells me, there is such a volume:
docker volume ls
DRIVER VOLUME NAME
local pgdata

So i am wondering what is wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.