remove backup user from dockerfile
This commit is contained in:
+1
-8
@@ -11,14 +11,7 @@ RUN --mount=type=cache,target=/var/cache/libdnf5 <<EOF
|
|||||||
# dnf install -y kernel-devel-$(uname -r | awk -F'-' '{print $1}')
|
# dnf install -y kernel-devel-$(uname -r | awk -F'-' '{print $1}')
|
||||||
dnf install -y https://zfsonlinux.org/fedora/zfs-release-3-1$(rpm --eval "%{dist}").noarch.rpm
|
dnf install -y https://zfsonlinux.org/fedora/zfs-release-3-1$(rpm --eval "%{dist}").noarch.rpm
|
||||||
dnf install -y zfs btop borgbackup
|
dnf install -y zfs btop borgbackup
|
||||||
|
dnf clean all && rm -rf /run/dnf && rm -rf /tmp/*
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
RUN useradd -m -d /var/home/backup -G wheel backup
|
|
||||||
ARG PASSWORD
|
|
||||||
RUN echo "backup:${PASSWORD}" | chpasswd
|
|
||||||
RUN mkdir /backups && chown backup:backup /backups
|
|
||||||
|
|
||||||
COPY --chown=root:root --chmod=600 id_ed25519.pub /root/.ssh/authorized_keys
|
|
||||||
COPY --chown=backup:backup --chmod=600 id_ed25519.pub /var/home/backup/.ssh/authorized_keys
|
|
||||||
|
|
||||||
RUN bootc container lint
|
RUN bootc container lint
|
||||||
|
|||||||
@@ -2,11 +2,9 @@ REPO="gitea.wefers.page/julian/backup-server"
|
|||||||
TAG="latest"
|
TAG="latest"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
read -srp "Desired password for user 'backup' in resulting container image: " password
|
|
||||||
# ABSOLUTELY DO NOT USE --squash, as ostree NEEDS the layers
|
# ABSOLUTELY DO NOT USE --squash, as ostree NEEDS the layers
|
||||||
sudo buildah build \
|
sudo buildah build \
|
||||||
-t ${REPO}:${TAG} \
|
-t ${REPO}:${TAG} \
|
||||||
--build-arg PASSWORD="${password}" \
|
|
||||||
--pull \
|
--pull \
|
||||||
--layers \
|
--layers \
|
||||||
--format oci \
|
--format oci \
|
||||||
|
|||||||
+15
@@ -1,3 +1,18 @@
|
|||||||
|
[customizations]
|
||||||
|
hostname = "backupserver"
|
||||||
|
|
||||||
|
[[customizations.user]]
|
||||||
|
name = "backup"
|
||||||
|
description = "Default user account"
|
||||||
|
password = "$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L..."
|
||||||
|
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGPAWtzq2/cuv+zPzdDSCe/5pc0HRCxmwFiI5Fu3sEok julian@local"
|
||||||
|
home = "/srv/widget/"
|
||||||
|
shell = "/usr/bin/bash"
|
||||||
|
groups = ["widget", "users", "wheel"]
|
||||||
|
uid = 1200
|
||||||
|
gid = 1200
|
||||||
|
expiredate = 12345
|
||||||
|
|
||||||
[customizations.iso]
|
[customizations.iso]
|
||||||
volume_id = "JuliansBackupServer"
|
volume_id = "JuliansBackupServer"
|
||||||
application_id = "JuliansBackupServer"
|
application_id = "JuliansBackupServer"
|
||||||
|
|||||||
Reference in New Issue
Block a user