I’ve been thinking to upgrade my Nextcloud service also switching to another alternative rather than docker, hence I used podman and buildah in my solution.

From the rockylinux.org I found a nice post where it describes how to build and provisioning by using buildah and podman, it works pretty good and I added a tool in order to run it faster, called taskfile.

Requirements:

  • Podman
  • Buildah
  • Taskfile
  1. Install taskfile
  2. Clone my project
  3. From the project you can see the task defined:
version: "3"

tasks:
  up-db:
    dir: "db/mariadb"
    preconditions:
      - test -f db-init.sh
    cmds:
      - bash db-init.sh

  create-app:
    dir: "app"
    preconditions:
      - test -f run.sh
    cmds:
      - mkdir nc nc/nextcloud nc/apps nc/config nc/data
      - task: up-db
      - bash run.sh

  build_base:
    dir: "db/base"
    preconditions:
      - test -f build.sh
    cmds:
      - bash build.sh

  build_tools:
    dir: "db/db-tools"
    preconditions:
      - test -f build.sh
    cmds:
      - bash build.sh

  build_maria:
    dir: "db/mariadb"
    preconditions:
      - test -f build.sh
    cmds:
      - bash build.sh

  build_db:
    cmds:
      - task: build_base
      - task: build_tools
      - task: build_maria

  up-app:
    cmds:
      - podman container start nextcloud

Main task to build and run nextcloud:

task build_db # build the DB container
task create-app # run both DB and nextcloud application