lobaro / restic-backup-docker

A docker container to automate backups with restic
Apache License 2.0
330 stars 114 forks source link

Push Docker HUB #39

Closed wuast94 closed 4 years ago

wuast94 commented 4 years ago

Can you please update the latest build to docker hub?

the latest update there is 7 month ago and in this build rclone is not included

niondir commented 4 years ago

Just started it, but it fails on DockerHub. I have to investigate a bit more in setting up the build pipeline. I'm not satisfied with it yet. I have auto build on but the build does not trigger on commits in master :/

Maybe also TravisCI would be an option. Any hints on how to setup the docker build best are welcome :)

niondir commented 4 years ago

Need to fix this. mailx must be installed in alpine and copied over like the other binaries. Not sure if that works or if we need more files then.

Building in Docker Cloud's infrastructure...
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '140.82.114.4' to the list of known hosts.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.
KernelVersion: 4.4.0-1060-aws
Components: [{u'Version': u'18.03.1-ee-3', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.4.0-1060-aws', u'Os': u'linux', u'BuildTime': u'2018-08-30T18:42:30.000000000+00:00', u'ApiVersion': u'1.37', u'MinAPIVersion': u'1.12', u'GitCommit': u'b9a5c95', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.10.2'}}]
Arch: amd64
BuildTime: 2018-08-30T18:42:30.000000000+00:00
ApiVersion: 1.37
Platform: {u'Name': u''}
Version: 18.03.1-ee-3
MinAPIVersion: 1.12
GitCommit: b9a5c95
Os: linux
GoVersion: go1.10.2
Starting build of index.docker.io/lobaro/restic-backup-docker:latest...
Step 1/28 : FROM alpine:3.10.1 as certs
---> b7b28af77ffe
Step 2/28 : RUN apk add --no-cache ca-certificates
---> Running in a09faf132072
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/1) Installing ca-certificates (20190108-r0)
Executing busybox-1.30.1-r2.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 6 MiB in 15 packages
Removing intermediate container a09faf132072
---> 64dedd2d2f44
Step 3/28 : ENV RESTIC_VERSION=0.9.5
---> Running in 499bc3c9fac8
Removing intermediate container 499bc3c9fac8
---> 90b078e6e0ba
Step 4/28 : ADD https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_amd64.bz2 /
---> 8fc304527d48
Step 5/28 : RUN bzip2 -d restic_${RESTIC_VERSION}_linux_amd64.bz2 && mv restic_${RESTIC_VERSION}_linux_amd64 /bin/restic && chmod +x /bin/restic
---> Running in 4f3946a0e709
Removing intermediate container 4f3946a0e709
---> f7b78e3bd4f0
Step 6/28 : FROM alpine as rclone
---> 961769676411
Step 7/28 : ADD https://downloads.rclone.org/rclone-current-linux-amd64.zip /
---> f140c89bf7c8
Step 8/28 : RUN unzip rclone-current-linux-amd64.zip && mv rclone-*-linux-amd64/rclone /bin/rclone && chmod +x /bin/rclone
---> Running in daa3f1343ecc
Archive: rclone-current-linux-amd64.zip
creating: rclone-v1.49.3-linux-amd64/
inflating: rclone-v1.49.3-linux-amd64/rclone.1
inflating: rclone-v1.49.3-linux-amd64/README.txt
inflating: rclone-v1.49.3-linux-amd64/git-log.txt
inflating: rclone-v1.49.3-linux-amd64/README.html
inflating: rclone-v1.49.3-linux-amd64/rclone
Removing intermediate container daa3f1343ecc
---> 9f1e9668fd6d
Step 9/28 : FROM busybox:glibc
---> 8dacfc772af7
Step 10/28 : RUN apk add --update --no-cache heirloom-mailx
---> Running in 1583c2aa8373
/bin/sh: apk: not found
Removing intermediate container 1583c2aa8373
The command '/bin/sh -c apk add --update --no-cache heirloom-mailx' returned a non-zero code: 127
wuast94 commented 4 years ago

Apk? You mean apt right? On last step where the error occurs

sweenu commented 4 years ago

You're building on top of busybox so neither apk nor apt are available. I would suggest using an alpine as base image instead of busybox. Alpine is built right on top of busybox while still being a tiny image, there's no real drawbacks here :)

vfauth commented 4 years ago

Up. This should work now.

niondir commented 4 years ago

Build triggered. Waiting for result.

Just some problems with the test left:

Successfully tagged lobaro/restic-backup-docker:latest
Starting Test in docker-compose.test.yml...
sut uses an image, skipping
Creating network "bfphp4wzjbabsyhh2f6bdpk_default" with the default driver
Pulling sut (gcr.io/gcp-runtimes/container-structure-test:)...
latest: Pulling from gcp-runtimes/container-structure-test
Digest: sha256:cc5ff23f5c8d18e532664c6de2eab47e0d621b55b30ad47a1d4ee134220b3657
Status: Downloaded newer image for gcr.io/gcp-runtimes/container-structure-test:latest
Creating bfphp4wzjbabsyhh2f6bdpk_sut_1 ...
Creating bfphp4wzjbabsyhh2f6bdpk_sut_1 ... done
===================================
====== Test file: config.yml ======
===================================
=== RUN: restic package installation
--- FAIL
Error: error setting env vars: Error creating container: no such image
=== RUN: log directory exists
--- FAIL
Error: error setting env vars: Error creating container: no such image
=== RUN: cron log file exists
--- FAIL
Error: error setting env vars: Error creating container: no such image
=== RUN: backup script exists
--- FAIL
Error: error setting env vars: Error creating container: no such image
=== RUN: Metadata Test
--- FAIL
Error: Error retrieving image config: Error when inspecting image: no such image
===================================
============= RESULTS =============
===================================
Passes: 0
Failures: 5
Total tests: 5
FAIL
time="2020-01-07T15:35:17Z" level=fatal msg=FAIL
Removing bfphp4wzjbabsyhh2f6bdpk_sut_1 ...
Removing bfphp4wzjbabsyhh2f6bdpk_sut_1 ... done Going to remove bfphp4wzjbabsyhh2f6bdpk_sut_1
executing docker-compose.test.yml (1)
niondir commented 4 years ago

I never worked with this kind of tests before. When someone knows a fix, it's very welcome. For now I will disable it.

stephane-klein commented 4 years ago

@Niondir awaiting can you push lobaro/restic-backup-docker Docker Image manually? 🙏

niondir commented 4 years ago

There is a new "latest" tag. I'm testing it on my server using AWS and will create a versioned tag if successful.