diff --git a/podman-build.sh b/podman-build.sh index 679c085..94ac632 100644 --- a/podman-build.sh +++ b/podman-build.sh @@ -26,10 +26,9 @@ apt-get install --no-install-recommends -y \ pkg-config \ uidmap -go get golang.org/dl/go1.17.6 -go1.17.6 download +apt install --no-install-recommends -y jq wget curl make ca-certificates + -apt install --no-install-recommends -y jq wget curl make VERSION=$(curl -s https://api.github.com/repos/containers/podman/releases/latest | jq '.name' -r) export VERSION @@ -40,29 +39,18 @@ git checkout tags/$VERSION make ENABLE_BUILDTAGS="systemd" binaries +# copy the binaries to mounted build folder and go back to root home cp -vr bin/ ../build -#!/bin/bash - cd /root/ -apt update -apt upgrade -y -apt install -y jq wget curl make +# remove v in version name +NVERSION=$(echo $VERSION | sed s/v//) -VERSION=$(curl -s https://api.github.com/repos/containers/podman/releases/latest | jq '.name' -r) -export VERSION - -cp -vr build/ bin/ - -VERSION=$(echo $VERSION | sed s/v//) ## PREPARE to package into .deb mkdir -p podman-deb/DEBIAN -mkdir -p podman-deb/usr/local/bin -mkdir -p podman-deb/usr/lib/systemd/system/ - cat < podman-deb/DEBIAN/control Package: podman -Version: $VERSION +Version: $NVERSION Depends: libgpgme11 Section: base Priority: optional @@ -73,6 +61,15 @@ Description: Podman container engine EOF +# CNI plugins +mkdir -p podman-deb/etc/containers/ +curl -L -o podman-deb/etc/containers/registries.conf https://src.fedoraproject.org/rpms/containers-common/raw/main/f/registries.conf +curl -L -o podman-deb/etc/containers/policy.json https://src.fedoraproject.org/rpms/containers-common/raw/main/f/default-policy.json + + +# Systemd service and socket files +mkdir -p podman-deb/usr/lib/systemd/system/ + cat < podman-deb/usr/lib/systemd/system/podman.service [Unit] Description=Podman API Service @@ -107,11 +104,14 @@ WantedBy=sockets.target EOF +# Copy the binaries +mkdir -p podman-deb/usr/local/bin cp -v build/bin/podman podman-deb/usr/local/bin/ cp -v build/bin/podman-remote podman-deb/usr/local/bin/ cp -v build/bin/quadlet podman-deb/usr/local/bin/ cp -v build/bin/rootlessport podman-deb/usr/local/bin/ - # ofc the permission chmod 755 podman-deb/usr/local/bin/* + +# Finally build the .deb dpkg-deb --build podman-deb build