Skip to content

Commit f49f678

Browse files
author
SebastianRzk
committed
add arm64 and basic updates
1 parent e7201a6 commit f49f678

File tree

5 files changed

+23
-67
lines changed

5 files changed

+23
-67
lines changed
Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI to Docker Hub
1+
name: CI to Docker Hub with ssh
22

33
on:
44
push:
@@ -10,38 +10,13 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
-
14-
name: Checkout
15-
uses: actions/checkout@v2
16-
-
17-
name: Set up Docker Buildx
18-
id: buildx
19-
uses: docker/setup-buildx-action@v1
20-
-
21-
name: Cache Docker layers
22-
uses: actions/cache@v2
23-
with:
24-
path: /tmp/.buildx-cache
25-
key: ${{ runner.os }}-buildx-${{ github.sha }}
26-
restore-keys: |
27-
${{ runner.os }}-buildx-
28-
-
29-
uses: docker/login-action@v1
30-
with:
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_PASSWORD }}
3313
-
34-
name: Build and push
35-
id: docker_build
36-
uses: docker/build-push-action@v2
14+
name: Build and push bord backup container with ssh
15+
id: docker_build_borg-backup-container
16+
uses: docker/build-push-action@v6
3717
with:
3818
context: ./borg-backup-docker/
3919
file: ./borg-backup-docker/Dockerfile.with_ssh
40-
builder: ${{ steps.buildx.outputs.name }}
20+
platforms: linux/amd64,linux/arm64
4121
push: true
42-
tags: sebastianrzk/borg-backup-container-with-ssh:latest
43-
cache-from: type=local,src=/tmp/.buildx-cache
44-
cache-to: type=local,dest=/tmp/.buildx-cache
45-
-
46-
name: Image digest
47-
run: echo ${{ steps.docker_build.outputs.digest }}
22+
tags: ${{ secrets.DOCKER_USERNAME }}/borg-backup-container-with-ssh:latest

.github/workflows/docker-to-docker-hub.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,13 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
-
14-
name: Checkout
15-
uses: actions/checkout@v2
16-
-
17-
name: Set up Docker Buildx
18-
id: buildx
19-
uses: docker/setup-buildx-action@v1
20-
-
21-
name: Cache Docker layers
22-
uses: actions/cache@v2
23-
with:
24-
path: /tmp/.buildx-cache
25-
key: ${{ runner.os }}-buildx-${{ github.sha }}
26-
restore-keys: |
27-
${{ runner.os }}-buildx-
28-
-
29-
uses: docker/login-action@v1
30-
with:
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_PASSWORD }}
3313
-
34-
name: Build and push
35-
id: docker_build
36-
uses: docker/build-push-action@v2
14+
name: Build and push bord backup container
15+
id: docker_build_borg-backup-container
16+
uses: docker/build-push-action@v6
3717
with:
3818
context: ./borg-backup-docker/
3919
file: ./borg-backup-docker/Dockerfile
40-
builder: ${{ steps.buildx.outputs.name }}
20+
platforms: linux/amd64,linux/arm64
4121
push: true
42-
tags: sebastianrzk/borg-backup-container:latest
43-
cache-from: type=local,src=/tmp/.buildx-cache
44-
cache-to: type=local,dest=/tmp/.buildx-cache
45-
-
46-
name: Image digest
47-
run: echo ${{ steps.docker_build.outputs.digest }}
22+
tags: ${{ secrets.DOCKER_USERNAME }}/borg-backup-container:latest

borg-backup-docker/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ FROM alpine
22

33
ENV BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
44
COPY requirements.txt /requirements.txt
5-
RUN apk add python3 py3-pip borgbackup bash && pip3 install -r /requirements.txt
5+
RUN apk add python3 py3-pip py3-virtualenv borgbackup bash && \
6+
python3 -m venv /venv && \
7+
/venv/bin/pip install --upgrade pip && \
8+
/venv/bin/pip install -r /requirements.txt
69
COPY main.py /main.py
710
ADD entrypoint.sh /entrypoint.sh
811
RUN chmod +x /entrypoint.sh
9-
ENTRYPOINT bash /entrypoint.sh
12+
ENTRYPOINT ["bash", "/entrypoint.sh"]

borg-backup-docker/Dockerfile.with_ssh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ FROM alpine
22

33
ENV BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
44
COPY requirements.txt /requirements.txt
5-
RUN apk add python3 py3-pip borgbackup bash openssh && pip3 install -r /requirements.txt
5+
RUN apk add python3 py3-pip py3-virtualenv borgbackup bash openssh && \
6+
python3 -m venv /venv && \
7+
/venv/bin/pip install --upgrade pip && \
8+
/venv/bin/pip install -r /requirements.txt
69
COPY main.py /main.py
710
ADD entrypoint.sh /entrypoint.sh
811
RUN chmod +x /entrypoint.sh
9-
ENTRYPOINT bash /entrypoint.sh
12+
ENTRYPOINT ["bash", "/entrypoint.sh"]

borg-backup-docker/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' > /contai
88
# Setup a cron schedule
99
echo "SHELL=/bin/bash
1010
BASH_ENV=/container.env
11-
$BORG_BACKUP_CRON python3 /main.py
11+
$BORG_BACKUP_CRON source /venv/bin/activate && python3 /main.py
1212
# This extra line makes it a valid cron" > scheduler.txt;
1313

14+
source /venv/bin/activate
1415
python3 /main.py --initial-checkup
1516

1617
crontab scheduler.txt;
1718
crond -f;
18-

0 commit comments

Comments
 (0)