diff --git a/podman-seafile/10_install.sh b/podman-seafile/10_install.sh index 99f83ea..44ab652 100755 --- a/podman-seafile/10_install.sh +++ b/podman-seafile/10_install.sh @@ -34,7 +34,8 @@ export memcached_release export listen_if export listen_port -podman pull docker.io/seafileltd/seafile-mc:${seafile_release} && +source ${ABSDIR}/zz_build-images.sh +podman image exists ${seafile_image}:${seafile_release} && podman pull docker.io/library/memcached:${memcached_release} && podman pull docker.io/library/mariadb:${mariadb_release} && podman-compose up -d && diff --git a/podman-seafile/vars.sh b/podman-seafile/vars.sh index 3891f19..221fd9c 100644 --- a/podman-seafile/vars.sh +++ b/podman-seafile/vars.sh @@ -4,6 +4,7 @@ pod_name='podman-seafile' service_name="pod-${pod_name}.service" mariadb_release='10.3' memcached_release='1.6' +seafile_image='localhost/seafileltd/seafile-mc' seafile_release='8.0.8' dbvolume='podman-seafile_seafile-db' datavolume='podman-seafile_seafile-data' @@ -14,4 +15,4 @@ GARBAYE_SEAFILE_SERVER_HOSTNAME="${GARBAYE_SEAFILE_ENV_SERVER_HOSTNAME:-seafile. GARBAYE_SEAFILE_ADMIN_PASSWORD="${GARBAYE_SEAFILE_ENV_ADMIN_PASSWORD:-asecret}" GARBAYE_SEAFILE_ADMIN_EMAIL="${GARBAYE_SEAFILE_ENV_ADMIN_EMAIL:-laposte-seafile@garbaye.fr}" envvars='GARBAYE_SEAFILE_MYSQL_ROOT_PASSWORD' -upstream_images="docker.io/seafileltd/seafile-mc docker.io/library/mariadb docker.io/library/memcached" +upstream_images="${seafile_image} docker.io/library/mariadb docker.io/library/memcached" diff --git a/podman-seafile/zz_build-images.sh b/podman-seafile/zz_build-images.sh new file mode 100755 index 0000000..1d71825 --- /dev/null +++ b/podman-seafile/zz_build-images.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +ABSDIR="$( dirname "$(readlink -f -- "$0")" )" +source ${ABSDIR}/../functions.sh +source ${ABSDIR}/vars.sh + +ensure_pwd_is_scriptdir +ensure_not_root + +buildfolder=/tmp/seafile-$$ + +if ! podman image exists ${seafile_image}:${seafile_release}; then + mkdir ${buildfolder} && + git clone --depth=1 https://github.com/haiwen/seafile-docker.git ${buildfolder}/ && + sed_in_place "^FROM phusion/baseimage:focal-1.0.0" "FROM docker.io/phusion/baseimage:focal-1.0.0" ${buildfolder}/image/seafile_8.0/Dockerfile && + sed_in_place "SEAFILE_VERSION=" "SEAFILE_VERSION=${seafile_release}" ${buildfolder}/image/seafile_8.0/Dockerfile && + mv ${buildfolder}/scripts_8.0 ${buildfolder}/image/seafile_8.0/ && + podman build -t ${seafile_image}:${seafile_release} \ + -f ${buildfolder}/image/seafile_8.0/Dockerfile \ + ${buildfolder}/image/seafile_8.0 && + podman rmi phusion/baseimage:focal-1.0.0 + rm -rf ${buildfolder} +fi