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 https://zfsonlinux.org/fedora/zfs-release-3-1$(rpm --eval "%{dist}").noarch.rpm
|
||||
dnf install -y zfs btop borgbackup
|
||||
dnf clean all && rm -rf /run/dnf && rm -rf /tmp/*
|
||||
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
|
||||
|
||||
@@ -2,11 +2,9 @@ REPO="gitea.wefers.page/julian/backup-server"
|
||||
TAG="latest"
|
||||
|
||||
build() {
|
||||
read -srp "Desired password for user 'backup' in resulting container image: " password
|
||||
# ABSOLUTELY DO NOT USE --squash, as ostree NEEDS the layers
|
||||
sudo buildah build \
|
||||
-t ${REPO}:${TAG} \
|
||||
--build-arg PASSWORD="${password}" \
|
||||
--pull \
|
||||
--layers \
|
||||
--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]
|
||||
volume_id = "JuliansBackupServer"
|
||||
application_id = "JuliansBackupServer"
|
||||
|
||||
Reference in New Issue
Block a user