Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using Podman instead of Docker #390

Merged
merged 2 commits into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ set -o xtrace
set -o errexit

# Check for dependencies
for dep in docker make mmv; do
command -v ${dep} &>/dev/null || { echo "The command '${dep}' is required."; exit 1; }
if ! command -v "docker" &>/dev/null && command -v "podman" &>/dev/null; then
container_cmd=podman
else
container_cmd=docker
fi

for dep in ${container_cmd} make mmv; do
command -v "${dep}" &>/dev/null || { echo "The command '${dep}' is required."; exit 1; }
done

image_name="jellyfin-ffmpeg-build-${cli_release}"
package_temporary_dir="$( mktemp -d )"
current_user="$( whoami )"

# Trap cleanup for latter sections
cleanup() {
Expand All @@ -98,15 +103,15 @@ trap cleanup EXIT INT
# Generate Dockerfile
make -f Dockerfile.make DISTRO=${release} GCC_VER=${gcc_version} LLVM_VER=${llvm_version} ARCH=${arch}
# Set up the build environment docker image
docker build . -t "${image_name}"
${container_cmd} build . -t "${image_name}"
# Build the APKs and copy out to ${package_temporary_dir}
docker run --rm -e "RELEASE=${release}" -v "${package_temporary_dir}:/dist" "${image_name}"
${container_cmd} run --rm -e "RELEASE=${release}" -v "${package_temporary_dir}:/dist" "${image_name}"
# If no 3rd parameter was specified, move APKs to parent directory
if [[ -z ${3} ]]; then
path="../bin"
else
path="${3}"
fi
mkdir ${path} &>/dev/null || true
mkdir "${path}" &>/dev/null || true
mmv "${package_temporary_dir}/deb/*.deb" "${path}/#1.deb"
mmv "${package_temporary_dir}/deb/*_${arch}.*" "${path}/#1-${cli_release}_${arch}.#2"
Loading