aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-07-17 18:33:44 +0100
committerdiogo464 <[email protected]>2025-07-17 18:33:44 +0100
commitc670837c11cf493255566642e553d9ecf2e17647 (patch)
treea1b748a4751203c7803a4f345e5bc5bc9025e71c
parentbd84f2d3409fb5d89ce2c9649f8a7766bc0b1a03 (diff)
added container image and build script
-rw-r--r--Containerfile8
-rwxr-xr-xbuild.sh23
2 files changed, 31 insertions, 0 deletions
diff --git a/Containerfile b/Containerfile
new file mode 100644
index 0000000..326532f
--- /dev/null
+++ b/Containerfile
@@ -0,0 +1,8 @@
1FROM alpine:latest
2RUN apk add --no-cache zfs zfs-lts
3
4COPY target/x86_64-unknown-linux-musl/release/zsnap /usr/local/bin/zsnap
5
6ENV ZSNAP_CONFIG=/etc/zsnap.toml
7
8CMD ["zsnap", "run"]
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..37d0f91
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,23 @@
1#!/bin/bash
2set -euo pipefail
3
4# Build zsnap for musl target
5echo "Building zsnap for x86_64-unknown-linux-musl..."
6
7# Install musl target if not already installed
8rustup target add x86_64-unknown-linux-musl
9
10# Build the binary
11cargo build --release --target x86_64-unknown-linux-musl --target-dir target/
12
13echo "Build completed successfully!"
14echo "Binary location: target/x86_64-unknown-linux-musl/release/zsnap"
15
16# Build and push container image
17echo "Building container image..."
18podman build -t cr.d464.sh/zsnap:latest .
19
20echo "Pushing container image..."
21podman push cr.d464.sh/zsnap:latest
22
23echo "Container image pushed successfully!" \ No newline at end of file