mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-04-04 12:18:50 +00:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47d29529e9 | ||
|
|
97c74a94a7 | ||
|
|
901cd5487f | ||
|
|
a66e72cb7e | ||
|
|
5f2b322e54 | ||
|
|
50e6fdbdf2 | ||
|
|
281c77f000 | ||
|
|
2dd2b9ec2f | ||
|
|
d864717eca | ||
|
|
5b057f7554 | ||
|
|
aac1a371e1 | ||
|
|
ff27b6e0c4 | ||
|
|
424d4552cc | ||
|
|
30df2e301a | ||
|
|
4a3487bc1a | ||
|
|
61e741240d | ||
|
|
646a4ffc40 | ||
|
|
db48b9982a | ||
|
|
3c113ab2f4 | ||
|
|
f695ea5253 | ||
|
|
e38f19c6d2 | ||
|
|
214edc2721 | ||
|
|
e75e026e92 | ||
|
|
740b897581 | ||
|
|
e7b7efa431 | ||
|
|
53aba762e2 | ||
|
|
dbd3e9c459 | ||
|
|
36e90b55e1 | ||
|
|
04fa95a5be | ||
|
|
0fd1e1da91 | ||
|
|
157bc07533 | ||
|
|
1b7d44a85e | ||
|
|
b2c209cbc0 | ||
|
|
9967b3fb2a | ||
|
|
2f0ce618b8 | ||
|
|
b2616ef2dc | ||
|
|
9b829f90e0 | ||
|
|
bf2dabd2c7 | ||
|
|
c2ae895ed8 | ||
|
|
47b30e90b1 | ||
|
|
e25f09d0ce |
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Docs: <https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/customizing-dependency-updates>
|
||||
version: 2
|
||||
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule: {interval: monthly}
|
||||
|
||||
- package-ecosystem: docker
|
||||
directory: /
|
||||
schedule: {interval: monthly}
|
||||
15
.github/workflows/docker-publish.yml
vendored
15
.github/workflows/docker-publish.yml
vendored
@@ -33,25 +33,25 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Install the cosign tool except on PR
|
||||
# https://github.com/sigstore/cosign-installer
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
|
||||
uses: sigstore/cosign-installer@v3.8.2
|
||||
with:
|
||||
cosign-release: 'v2.1.1'
|
||||
cosign-release: 'v2.4.3'
|
||||
|
||||
# Workaround: https://github.com/docker/build-push-action/issues/461
|
||||
- name: Setup Docker buildx
|
||||
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Login against a Docker registry except on PR
|
||||
# https://github.com/docker/login-action
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
# https://github.com/docker/metadata-action
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
@@ -69,9 +69,10 @@ jobs:
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,12 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
## v1.4.2
|
||||
### Removed
|
||||
* Execute a repository check after prune was passed as a parameter in the forget call - use RESTIC_CHECK_CRON Var instead
|
||||
|
||||
## v1.3.2+restic-0-16-0
|
||||
## v1.4.1
|
||||
### Changed
|
||||
* Execute a repository check after prune was passed as a parameter in the forget call
|
||||
|
||||
## v1.4.0
|
||||
|
||||
### Added
|
||||
* Option to set the target folder backup
|
||||
* Multi-platform image build
|
||||
|
||||
## v1.3.2 (restic 0.16.0)
|
||||
|
||||
### Changed
|
||||
* Base image directly on official restic image
|
||||
* [Semver](https://semver.org/) aligned version naming including restic version
|
||||
* Updated to restic 0.16.0
|
||||
|
||||
### Added
|
||||
* rclone to docker image
|
||||
|
||||
20
Dockerfile
20
Dockerfile
@@ -1,12 +1,21 @@
|
||||
FROM alpine:latest as rclone
|
||||
FROM --platform=$TARGETPLATFORM docker.io/alpine:latest as rclone
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN apk add wget
|
||||
|
||||
# Get rclone executable
|
||||
ADD https://downloads.rclone.org/rclone-current-linux-amd64.zip /
|
||||
RUN unzip rclone-current-linux-amd64.zip && mv rclone-*-linux-amd64/rclone /bin/rclone && chmod +x /bin/rclone
|
||||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
||||
wget https://downloads.rclone.org/rclone-current-linux-amd64.zip && unzip rclone-current-linux-amd64.zip && mv rclone-*-linux-amd64/rclone /bin/rclone && chmod +x /bin/rclone; \
|
||||
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
|
||||
wget https://downloads.rclone.org/rclone-current-linux-arm64.zip && unzip rclone-current-linux-arm64.zip && mv rclone-*-linux-arm64/rclone /bin/rclone && chmod +x /bin/rclone; \
|
||||
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
|
||||
wget https://downloads.rclone.org/rclone-current-linux-arm-v7.zip && unzip rclone-current-linux-arm-v7.zip && mv rclone-*-linux-arm-v7/rclone /bin/rclone && chmod +x /bin/rclone; \
|
||||
fi
|
||||
|
||||
FROM restic/restic:0.16.0
|
||||
|
||||
RUN apk add --update --no-cache curl mailx
|
||||
FROM docker.io/restic/restic:0.18.0
|
||||
|
||||
RUN apk add --update --no-cache curl mailx shadow
|
||||
|
||||
COPY --from=rclone /bin/rclone /bin/rclone
|
||||
|
||||
@@ -35,6 +44,7 @@ ENV OS_PASSWORD=""
|
||||
ENV OS_REGION_NAME=""
|
||||
ENV OS_INTERFACE=""
|
||||
ENV OS_IDENTITY_API_VERSION=3
|
||||
ENV BACKUP_SOURCES=""
|
||||
|
||||
# openshift fix
|
||||
RUN mkdir /.cache && \
|
||||
|
||||
15
README.md
15
README.md
@@ -11,11 +11,16 @@ This container runs restic backups in regular intervals.
|
||||
* [ghcr.io/lobaro/restic-backup-docker](https://github.com/lobaro/restic-backup-docker/pkgs/container/restic-backup-docker)
|
||||
* Old: [lobaro/restic-backup-docker](https://hub.docker.com/r/lobaro/restic-backup-docker/)
|
||||
|
||||
Latest (experimental):
|
||||
Latest master (experimental):
|
||||
```
|
||||
docker pull ghcr.io/lobaro/restic-backup-docker:master
|
||||
```
|
||||
|
||||
Latest release:
|
||||
```
|
||||
docker pull ghcr.io/lobaro/restic-backup-docker:latest
|
||||
```
|
||||
|
||||
# Contributing
|
||||
Pull Requests to improve the image are always wellcome. Please create an issue about the PR first.
|
||||
|
||||
@@ -137,6 +142,7 @@ The container is set up by setting [environment variables](https://docs.docker.c
|
||||
* `OS_REGION_NAME` - Optional. When using restic with OpenStack Swift container.
|
||||
* `OS_INTERFACE` - Optional. When using restic with OpenStack Swift container.
|
||||
* `OS_IDENTITY_API_VERSION` - Optional. When using restic with OpenStack Swift container.
|
||||
* `BACKUP_SOURCES` - Optional. Set the folder that will be backed up.
|
||||
|
||||
## Volumes
|
||||
|
||||
@@ -196,7 +202,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
restic:
|
||||
image: lobaro/restic-backup-docker:latest
|
||||
image: ghcr.io/lobaro/restic-backup-docker:latest
|
||||
hostname: nas # This will be visible in restic snapshot list
|
||||
restart: always
|
||||
privileged: true
|
||||
@@ -216,10 +222,5 @@ services:
|
||||
```
|
||||
|
||||
# Versioning
|
||||
|
||||
Starting from v1.3.0 versioning follows [Semantic versioning](http://semver.org/)
|
||||
|
||||
Build metadata is used to declare the Restic version.
|
||||
|
||||
**Example:** v1.3.2+restic-0-16-0 (includes Restic 0.16.0)
|
||||
|
||||
|
||||
@@ -4,6 +4,12 @@ lastLogfile="/var/log/backup-last.log"
|
||||
lastMailLogfile="/var/log/mail-last.log"
|
||||
lastMicrosoftTeamsLogfile="/var/log/microsoft-teams-last.log"
|
||||
|
||||
if [ -n "$BACKUP_SOURCES" ]; then
|
||||
backupSources="$BACKUP_SOURCES"
|
||||
else
|
||||
backupSources="/data"
|
||||
fi
|
||||
|
||||
copyErrorLog() {
|
||||
cp ${lastLogfile} /var/log/backup-error-last.log
|
||||
}
|
||||
@@ -31,7 +37,7 @@ logLast "RESTIC_REPOSITORY: ${RESTIC_REPOSITORY}"
|
||||
logLast "AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}"
|
||||
|
||||
# Do not save full backup log to logfile but to backup-last.log
|
||||
restic backup /data ${RESTIC_JOB_ARGS} --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} >> ${lastLogfile} 2>&1
|
||||
restic backup ${backupSources} ${RESTIC_JOB_ARGS} --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} >> ${lastLogfile} 2>&1
|
||||
backupRC=$?
|
||||
logLast "Finished backup at $(date)"
|
||||
if [[ $backupRC == 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user