28 lines
1.1 KiB
Bash
Executable file
28 lines
1.1 KiB
Bash
Executable file
#!/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.2.0" "FROM docker.io/phusion/baseimage:focal-1.2.0" ${buildfolder}/image/seafile_10.0/Dockerfile &&
|
|
sed_in_place "SEAFILE_VERSION=" "SEAFILE_VERSION=${seafile_release}" ${buildfolder}/image/seafile_10.0/Dockerfile &&
|
|
mv ${buildfolder}/scripts_10.0 ${buildfolder}/image/seafile_10.0/ &&
|
|
podman build -t ${seafile_image}:${seafile_release} \
|
|
-f ${buildfolder}/image/seafile_10.0/Dockerfile \
|
|
${buildfolder}/image/seafile_10.0 &&
|
|
podman rmi phusion/baseimage:focal-1.2.0
|
|
rm -rf ${buildfolder}
|
|
else
|
|
echo "Image ${seafile_image}:${seafile_release} already built"
|
|
fi
|
|
|
|
oci_push_to_registry ${seafile_image}:${seafile_release}
|