Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions apps/resticprofile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# syntax=docker/dockerfile:1
FROM alpine:latest
Comment on lines +1 to +2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# syntax=docker/dockerfile:1
FROM alpine:latest
# syntax=docker/dockerfile:1
FROM docker.io/library/alpine:3.23


ARG TARGETARCH
ARG VERSION

COPY --from=ghcr.io/creativeprojects/resticprofile:latest /usr/bin/restic /usr/bin/restic
COPY --from=ghcr.io/creativeprojects/resticprofile:latest /usr/bin/rclone /usr/bin/rclone
Comment on lines +7 to +8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably be installed with apk


RUN apk add --no-cache ca-certificates curl logrotate openssh-client-default tzdata supercronic && \
curl -fsSL -o /resticprofile.tar.gz https://github.com/creativeprojects/resticprofile/releases/download/v${VERSION}/resticprofile_${VERSION}_linux_${TARGETARCH}.tar.gz && \
tar xvzf /resticprofile.tar.gz -C /usr/bin resticprofile && \
rm /resticprofile.tar.gz && \
chmod +x /usr/bin/restic /usr/bin/rclone /usr/bin/resticprofile && \
adduser -D -h /resticprofile resticprofile && \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is adding a user really necessary over using nobody:nogroup?

mkdir -p /resticprofile && \
touch /resticprofile/crontab && \
chown -R resticprofile:resticprofile /resticprofile

USER resticprofile
VOLUME /resticprofile
WORKDIR /resticprofile
Comment on lines +20 to +22
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
USER resticprofile
VOLUME /resticprofile
WORKDIR /resticprofile
USER nobody:nogroup
WORKDIR /resticprofile
VOLUME ["/resticprofile"]

or if this could be /config, that would work too


ENTRYPOINT ["resticprofile"]
CMD ["--help"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not helpful, I would create a entrypoint.sh with defaults

14 changes: 14 additions & 0 deletions apps/resticprofile/container_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"context"
"testing"

"github.com/home-operations/containers/testhelpers"
)

func Test(t *testing.T) {
ctx := context.Background()
image := testhelpers.GetTestImage("ghcr.io/home-operations/resticprofile:rolling")
testhelpers.TestCommandSucceeds(t, ctx, image, nil, "/usr/bin/resticprofile", "--help")
}
42 changes: 42 additions & 0 deletions apps/resticprofile/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
target "docker-metadata-action" {}

variable "APP" {
default = "resticprofile"
}

variable "VERSION" {
// renovate: datasource=docker depName=docker.io/creativeprojects/resticprofile
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version should come from github-releases

default = "0.33.0"
}

variable "SOURCE" {
default = "https://github.com/creativeprojects/resticprofile/"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default = "https://github.com/creativeprojects/resticprofile/"
default = "https://github.com/creativeprojects/resticprofile"

}

group "default" {
targets = ["image-local"]
}

target "image" {
inherits = ["docker-metadata-action"]
args = {
VERSION = "${VERSION}"
}
labels = {
"org.opencontainers.image.source" = "${SOURCE}"
}
}

target "image-local" {
inherits = ["image"]
output = ["type=docker"]
tags = ["${APP}:${VERSION}"]
}

target "image-all" {
inherits = ["image"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}
Loading