Skip to content

Commit 220d909

Browse files
authored
feat(kopia): add new container (#698)
Signed-off-by: Devin Buhl <[email protected]>
1 parent 672a84b commit 220d909

File tree

4 files changed

+108
-0
lines changed

4 files changed

+108
-0
lines changed

apps/kopia/Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM docker.io/library/alpine:3.22
4+
ARG TARGETARCH
5+
ARG TARGETARCH=${TARGETARCH/amd64/x64}
6+
ARG VERSION
7+
8+
ENV \
9+
KOPIA_CHECK_FOR_UPDATES=false \
10+
KOPIA_CONFIG_PATH=/config/repository.config \
11+
KOPIA_CACHE_DIRECTORY=/config/cache \
12+
KOPIA_LOG_DIR=/config/logs \
13+
KOPIA_PERSIST_CREDENTIALS_ON_CONNECT=false
14+
15+
ENV \
16+
KOPIA_WEB_ENABLED=true \
17+
KOPIA_WEB_PORT=51515
18+
19+
USER root
20+
21+
RUN \
22+
apk add --no-cache \
23+
ca-certificates \
24+
catatonit \
25+
curl \
26+
bash \
27+
jq \
28+
nano \
29+
tzdata \
30+
&& \
31+
mkdir -p /app/bin \
32+
&& curl -fsSL "https://github.com/kopia/kopia/releases/download/${VERSION}/kopia-${VERSION#*v}-linux-${TARGETARCH}.tar.gz" \
33+
| tar xzf - -C /app/bin --strip-components 1 \
34+
&& chown -R root:root /app && chmod -R 755 /app \
35+
&& rm -rf /tmp/*
36+
37+
COPY . /
38+
39+
USER nobody:nogroup
40+
WORKDIR /config
41+
VOLUME ["/config"]
42+
43+
ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"]

apps/kopia/docker-bake.hcl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
target "docker-metadata-action" {}
2+
3+
variable "APP" {
4+
default = "kopia"
5+
}
6+
7+
variable "VERSION" {
8+
// renovate: datasource=github-releases depName=kopia/kopia
9+
default = "v0.21.1"
10+
}
11+
12+
variable "SOURCE" {
13+
default = "https://github.com/kopia/kopia"
14+
}
15+
16+
group "default" {
17+
targets = ["image-local"]
18+
}
19+
20+
target "image" {
21+
inherits = ["docker-metadata-action"]
22+
args = {
23+
VERSION = "${VERSION}"
24+
}
25+
labels = {
26+
"org.opencontainers.image.source" = "${SOURCE}"
27+
}
28+
}
29+
30+
target "image-local" {
31+
inherits = ["image"]
32+
output = ["type=docker"]
33+
tags = ["${APP}:${VERSION}"]
34+
}
35+
36+
target "image-all" {
37+
inherits = ["image"]
38+
platforms = [
39+
"linux/amd64",
40+
"linux/arm64"
41+
]
42+
}

apps/kopia/entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ ${KOPIA_WEB_ENABLED} == "true" ]]; then
4+
exec \
5+
/app/bin/kopia \
6+
server \
7+
start \
8+
--insecure \
9+
--address "0.0.0.0:${KOPIA_WEB_PORT}" \
10+
"$@"
11+
else
12+
exec \
13+
/app/bin/kopia \
14+
"$@"
15+
fi

apps/kopia/tests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml
3+
process:
4+
kopia:
5+
running: true
6+
file:
7+
/app/bin/kopia:
8+
exists: true

0 commit comments

Comments
 (0)