This page (revision-4) was last changed on 26-Dec-2022 11:33 by Markus Monderkamp 

This page was created on 26-Dec-2022 11:09 by Markus Monderkamp

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
4 26-Dec-2022 11:33 7 KB Markus Monderkamp to previous Noch einen Typo behoben und Kommentare überarbeitet
3 26-Dec-2022 11:15 8 KB Markus Monderkamp to previous | to last Noch einen Rechtschreibfehler korrigiert
2 26-Dec-2022 11:14 8 KB Markus Monderkamp to previous | to last 3 oder 4 Typos korrigiert
1 26-Dec-2022 11:09 8 KB Markus Monderkamp to last Eintrag zur einfacheren Nextcloud-Installation angelegt

Page References

Incoming links Outgoing links

Version management

Difference between version and

!!!Nextcloud mit Podman - ziemlich einfach

Quelle: https://www.linux-community.de/ausgaben/linuxuser/2022/06/nextcloud-mit-podman-aufsetzen/

Alle Angaben ohne Gewähr. Bei mir läuft das Nextcloud-Geraffel momentan. \\
Nach der erstmaligen Installation brauche ich bei den nächsten Rechnerneustarts nur das letzte Skript, \\
~/src/sh/podman-nextcloud/nextcloud-podman-start.sh, aufzurufen, damit Nextcloud im Container wieder gestartet wird. \\
Nextcloud lauscht dann auf __http(s)://<HOSTNAMEN HIER EINSETZEN>:8080__, Podman-Cockpit auf http...:9090. \\
Für podman-cockpit muss der Systemd-Dienst cockpit laufen, z.B. so:
%%prettify
{{{
sudo systemctl start cockpit
}}}
/%
(Oder für automatischen Start nachanch Rechnerneustart den systemd-Service "cockpit" enablen.)


__Inhalt von Datei ~/src/sh/podman-nextcloud/arch-install-podman.sh:__
%%prettify
{{{
#!/usr/bin/bash
#
# podman-nextcloud-install.sh
#
# Anleitung aus LU202206, S. 64-69
#
# Das Paket "cockpit-podman" installiert als Abhängigkeit "podman" per arch-pacman gleich mit.
sudo pacman -S cockpit-podman
sudo pacman -S toolbox
sudo pacman -S aardvark-dns

#[maxmon@isitan-hp podman-nextcloud]$ podman volume create nextcloud-app
#ERRO[0000] cannot find UID/GID for user maxmon: no subuid ranges found for user "maxmon" in /etc/subuid - check rootless mode in man pages.
#WARN[0000] Using rootless single mapping into the namespace. This might break some images. Check /etc/subuid and /etc/subgid for adding sub*ids if not using a network user
# nextcloud-app

#[maxmon@isitan-hp podman-nextcloud]$ podman volume create nextcloud-data
#nextcloud-data

#[maxmon@isitan-hp podman-nextcloud]$ podman volume create nextcloud-db
#nextcloud-db

#[maxmon@isitan-hp podman-nextcloud]$ podman network create nextcloud-net
#nextcloud-net
#podman network inspect nextcloud-net
[maxmon@isitan-hp podman-nextcloud]$ podman network inspect nextcloud-net
[
    {
          "name": "nextcloud-net",
          "id": "8a7d31a7706412030285081c40de303808a5852c81ebc4f7f02c3702eeb2b71a",
          "driver": "bridge",
          "network_interface": "podman1",
          "created": "2022-12-23T20:39:00.109278724+01:00",
          "subnets": [
                       {
                           "subnet": "10.89.0.0/24",
                           "gateway": "10.89.0.1"
                       }
                     ],
                     "ipv6_enabled": false,
                     "internal": false,
                     "dns_enabled": true,
                     "ipam_options": {
                     "driver": "host-local"
                 }
              }
             
#  The cockpit-ws web service listens on port 9090 and is started on demand by systemd.
#  http://localhost:9090
#
#  Fehler
#
#  Error while trying to create admin user:
#  Failed to connect to the database:
#  An exception occurred in the driver:
#  SQLSTATE[HY000] [2002] php_network_getaddresses:
#  getaddrinfo for nextcloud-db.dns.podman failed: Name or service not known
#  Administrator-Konto anlegen
#  
}}}
/%

__Inhalt von Datei ~/src/sh/podman-nextcloud/mariadb.sh:__
%%prettify
{{{
#!/usr/bin/bash
#
# mariadb.sh
#
# MariaDb im Podman-Container
#
# Artikel in LU-Magazin 202206, S. 64-69
#
podman run --detach \
       --env MYSQL_DATABASE=nextcloud \
       --env MYSQL_USER=nextcloud \
       --env MYSQL_PASSWORD=geheim123 \
       --env MYSQL_ROOT_PASSWORD=geheim1234 \
       --volume nextcloud-db:/var/lib/mysql \
       --network nextcloud-net \
       --restart on-failure \
       --name nextcloud-db \
docker.io/library/mariadb:10

# [maxmon@isitan-hp podman-nextcloud]$ ./mariadb.sh
# Trying to pull docker.io/library/mariadb:10...
# Getting image source signatures
# Copying blob c4a9b64b12f6 done
# [...]
# Copying blob 97533be58132 done  
# Error: copying system image from manifest list: writing blob: adding layer with blob
# "sha256:6e3729cf69e0ce2de9e779575a1fec8b7fb5efdfa822829290ab6d5d1bc3e797":
# processing tar file(potentially insufficient UIDs or GIDs available in user namespace (requested 0:42 for /etc/gshadow):
# Check /etc/subuid and /etc/subgid if configured locally and run podman-system-migrate:
# lchown /etc/gshadow: invalid argument): exit status 1
#
# Solution:
# https://forum.manjaro.org/t/no-etc-subuid-or-etc-subgid-files/119566
# https://wiki.archlinux.org/title/Podman#Rootless_Podman
#
# touch /etc/subuid /etc/subgid
# (usermod --add-subuids 100000-165535 --add-subgids 100000-165535 *username*)
# also Folgendes:
# sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 maxmon
#
# podman system migrate
#
# Writing manifest to image destination
# Storing signatures
# WARN[0038] aardvark-dns binary not found, container dns will not be enabled
# 43abc0daef3b8ed82557432654650196acc768a7ed39393c49ac2bb9808973a4
#
#[maxmon@isitan-hp podman-nextcloud]$ podman container list
#CONTAINER ID  IMAGE                         COMMAND     CREATED             STATUS                 PORTS       NAMES
#43abc0daef3b  docker.io/library/mariadb:10  mariadbd    About a minute ago  Up About a minute ago              nextcloud-db
#
}}}
/%

__Inhalt von Datei ~/src/sh/podman-nextcloud/nextcloud-install.sh:__
%%prettify
{{{
#!/usr/bin/bash
#
# nextcloud.sh
#
# NextCloud im Podman-Container
#
# Artikel in LU-Magazin 202206, S. 64-69
#
podman run --detach \
       --env MYSQL_HOST=nextcloud-db.dns.podman \
       --env MYSQL_DATABASE=nextcloud \
       --env MYSQL_USER=nextcloud \
       --env MYSQL_ADMIN_USER=NC-Admin \
       --env MYSQL_ADMIN_PASSWORD=geheim1234 \
       --volume nextcloud-app:/var/www/html \
       --volume nextcloud-data:/var/www/html/data \
       --network nextcloud-net \
       --restart on-failure \
       --name nextcloud \
       --publish 8080:80 \
docker.io/library/nextcloud:latest

#
#[...]
#Writing manifest to image destination
#Storing signatures
#WARN[0114] aardvark-dns binary not found, container dns will not be enabled
#89aa4f1e2c9c893f4b0554811e11c0a163b9019ab2bead0478a87ad45a978c81
#
#https://computingforgeeks.com/how-to-install-podman-on-arch-linux-manjaro/
#
#https://github.com/containers/aardvark-dns -> Details für podman-Container
#
# http://localhost:8080/index.php
#
#Fehler
#
#Error while trying to create admin user: Failed to connect to the database:
# An exception occurred in the driver:
# SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for nextcloud-db.dns.podman failed:
# Name or service not known
#
# Administrator-Konto anlegen
#
# Lösung:
# Bei der Installation des MariaDb-Admin-Users bitte den Host "nextcloud-db.dns.podman" ohne Anführungszeichen angeben! (25.12.2022)
(END)

}}}
/%


__Inhalt von Datei ~/src/sh/podman-nextcloud/nextcloud-podman-start.sh:__
%%prettify
{{{
[maxmon@isitan-hp podman-nextcloud]$ less start-nextcloud-container.sh
# [maxmon@isitan-hp podman-nextcloud]$ podman container list -all
# CONTAINER ID  IMAGE                               COMMAND               CREATED       STATUS         PORTS         NAMES
# 89aa4f1e2c9c  docker.io/library/nextcloud:latest  apache2-foregroun...  36 hours ago  Exited (0) 35 hours ago  0.0.0.0:8080->80/tcp  
nextcloud
#
#[maxmon@isitan-hp podman-nextcloud]$ podman start nextcloud-db
#nextcloud-db
podman start nextcloud-db nextcloud
systemctl start cockpit
#
# https://help.nextcloud.com/t/cron-failing-with-doctrine-dbal-exception-failed-to-connect-to-the-database/138869
# Zum Stoppen des Nextcloud-Containers, Einfach Herunterfahren des Rechners scheint auch zu funktionieren:
# podman stop nextcloud-db nextcloud
#
# Container löschen und neu anlegen:
# [maxmon@isitan-hp podman-nextcloud]$ podman rm nextcloud-db nextcloud
# nextcloud
# nextcloud-db
#
# Mounten eines Container-Verzeichnisbaums:
# [maxmon@isitan-hp podman-nextcloud]$ podman unshare podman volume mount nextcloud-data
# /home/maxmon/.local/share/containers/storage/volumes/nextcloud-data/_data
#
# __Tipp:__
# mit "hostname" und "ip addr" (ohne Anführungszeichen auf der Linux-Kommandozeile)
# komme ich als Anwender*in an den Hostnamen und die IP-Adresse des (Nextcloud-)Servers.
#
# Die URL für die lokale Nextcloud-Instanz lautet dann:
# http(s)://hostname:8080   (Nextcloud-Oberfläche, erster Nutzer: NC-Admin, s.o.)
# http(s)://hostname:9090   (für podman-cockpit)
}}}
/%