mirror of
https://gitlab.com/alliedmaldives/ops/podmanbuilder.git
synced 2025-06-12 20:38:42 +00:00
fresh start again, 1 step at a time this is go
This commit is contained in:
parent
15ee256519
commit
2b286d7d75
276
podman-build.sh
276
podman-build.sh
@ -1,123 +1,187 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
GO_VERSION=1.16.1
|
|
||||||
ARCH=amd64
|
|
||||||
|
|
||||||
cd /root/
|
cd /root/
|
||||||
|
|
||||||
apt update
|
apt install -y \
|
||||||
apt upgrade -y
|
btrfs-progs \
|
||||||
apt-get install --no-install-recommends -y \
|
curl \
|
||||||
btrfs-progs \
|
gcc \
|
||||||
crun \
|
git \
|
||||||
git \
|
iptables \
|
||||||
go-md2man \
|
libassuan-dev \
|
||||||
iptables \
|
libbtrfs-dev \
|
||||||
libassuan-dev \
|
libc6-dev \
|
||||||
libbtrfs-dev \
|
libdevmapper-dev \
|
||||||
libc6-dev \
|
libglib2.0-dev \
|
||||||
libdevmapper-dev \
|
libgpg-error-dev \
|
||||||
libglib2.0-dev \
|
libgpgme-dev \
|
||||||
libgpgme-dev \
|
libprotobuf-c-dev \
|
||||||
libgpg-error-dev \
|
libprotobuf-dev \
|
||||||
libprotobuf-dev \
|
libseccomp-dev \
|
||||||
libprotobuf-c-dev \
|
libselinux1-dev \
|
||||||
libseccomp-dev \
|
libsystemd-dev \
|
||||||
libselinux1-dev \
|
make \
|
||||||
libsystemd-dev \
|
pkg-config \
|
||||||
pkg-config \
|
runc \
|
||||||
uidmap
|
uidmap \
|
||||||
# golang-go \
|
vim
|
||||||
|
|
||||||
# depdencies for this script
|
wget https://storage.googleapis.com/golang/getgo/installer_linux
|
||||||
apt install --no-install-recommends -y jq wget curl make ca-certificates
|
chmod +x ./installer_linux
|
||||||
|
./installer_linux
|
||||||
# install go
|
source ~/.bash_profile
|
||||||
wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz
|
|
||||||
rm -rf /usr/local/go && tar -C /usr/local -xzf go$GO_VERSION.linux-$ARCH.tar.gz
|
|
||||||
PATH=$PATH:/usr/local/go/bin
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
# get podman
|
|
||||||
PODMAN_VERSION=$(curl -s https://api.github.com/repos/containers/podman/releases/latest | jq '.name' -r)
|
|
||||||
git clone https://github.com/containers/podman.git podman-$PODMAN_VERSION
|
|
||||||
cd podman-$PODMAN_VERSION
|
|
||||||
git checkout tags/$PODMAN_VERSION
|
|
||||||
|
|
||||||
make ENABLE_BUILDTAGS="systemd" binaries
|
|
||||||
|
|
||||||
# copy the binaries to mounted build folder and go back to root home
|
|
||||||
cp -vr bin/ ../build
|
|
||||||
cd /root/
|
|
||||||
|
|
||||||
# remove v in version name
|
|
||||||
PODMAN_NOV_VERSION=$(echo $PODMAN_VERSION | sed s/v//)
|
|
||||||
|
|
||||||
## PREPARE to package into .deb
|
|
||||||
mkdir -p podman-deb/DEBIAN
|
|
||||||
cat <<EOF > podman-deb/DEBIAN/control
|
|
||||||
Package: podman
|
|
||||||
Version: $PODMAN_NOV_VERSION
|
|
||||||
Depends: libgpgme11
|
|
||||||
Section: base
|
|
||||||
Priority: optional
|
|
||||||
Architecture: amd64
|
|
||||||
Maintainer: Shiham Abdul Rahman <shihaam@shihaam.me>
|
|
||||||
Description: Podman container engine
|
|
||||||
Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System.
|
|
||||||
|
|
||||||
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 <<EOF > podman-deb/usr/lib/systemd/system/podman.service
|
|
||||||
[Unit]
|
|
||||||
Description=Podman API Service
|
|
||||||
Requires=podman.socket
|
|
||||||
After=podman.socket
|
|
||||||
Documentation=man:podman-system-service(1)
|
|
||||||
StartLimitIntervalSec=0
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Delegate=true
|
|
||||||
Type=exec
|
|
||||||
KillMode=process
|
|
||||||
Environment=LOGGING="--log-level=info"
|
|
||||||
ExecStart=/usr/bin/podman $LOGGING system service
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF > podman-deb/usr/lib/systemd/system/podman.socket
|
|
||||||
[Unit]
|
|
||||||
Description=Podman API Socket
|
|
||||||
Documentation=man:podman-system-service(1)
|
|
||||||
|
|
||||||
[Socket]
|
|
||||||
ListenStream=%t/podman/podman.sock
|
|
||||||
SocketMode=0660
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#GO_VERSION=1.16.1
|
||||||
|
#ARCH=amd64
|
||||||
|
#
|
||||||
|
#cd /root/
|
||||||
|
#
|
||||||
|
#apt update
|
||||||
|
#apt upgrade -y
|
||||||
|
#apt-get install --no-install-recommends -y \
|
||||||
|
# btrfs-progs \
|
||||||
|
# crun \
|
||||||
|
# git \
|
||||||
|
# go-md2man \
|
||||||
|
# iptables \
|
||||||
|
# libassuan-dev \
|
||||||
|
# libbtrfs-dev \
|
||||||
|
# libc6-dev \
|
||||||
|
# libdevmapper-dev \
|
||||||
|
# libglib2.0-dev \
|
||||||
|
# libgpgme-dev \
|
||||||
|
# libgpg-error-dev \
|
||||||
|
# libprotobuf-dev \
|
||||||
|
# libprotobuf-c-dev \
|
||||||
|
# libseccomp-dev \
|
||||||
|
# libselinux1-dev \
|
||||||
|
# libsystemd-dev \
|
||||||
|
# pkg-config \
|
||||||
|
# uidmap
|
||||||
|
## golang-go \
|
||||||
|
#
|
||||||
|
## depdencies for this script
|
||||||
|
#apt install --no-install-recommends -y jq wget curl make ca-certificates
|
||||||
|
#
|
||||||
|
## install go
|
||||||
|
#wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz
|
||||||
|
#rm -rf /usr/local/go && tar -C /usr/local -xzf go$GO_VERSION.linux-$ARCH.tar.gz
|
||||||
|
#PATH=$PATH:/usr/local/go/bin
|
||||||
|
#export PATH
|
||||||
|
#
|
||||||
|
## get podman
|
||||||
|
#PODMAN_VERSION=$(curl -s https://api.github.com/repos/containers/podman/releases/latest | jq '.name' -r)
|
||||||
|
#git clone https://github.com/containers/podman.git podman-$PODMAN_VERSION
|
||||||
|
#cd podman-$PODMAN_VERSION
|
||||||
|
#git checkout tags/$PODMAN_VERSION
|
||||||
|
#
|
||||||
|
#make ENABLE_BUILDTAGS="systemd" binaries
|
||||||
|
#
|
||||||
|
## copy the binaries to mounted build folder and go back to root home
|
||||||
|
#cp -vr bin/ ../build
|
||||||
|
#cd /root/
|
||||||
|
#
|
||||||
|
## remove v in version name
|
||||||
|
#PODMAN_NOV_VERSION=$(echo $PODMAN_VERSION | sed s/v//)
|
||||||
|
#
|
||||||
|
### PREPARE to package into .deb
|
||||||
|
#mkdir -p podman-deb/DEBIAN
|
||||||
|
#cat <<EOF > podman-deb/DEBIAN/control
|
||||||
|
#Package: podman
|
||||||
|
#Version: $PODMAN_NOV_VERSION
|
||||||
|
#Depends: libgpgme11
|
||||||
|
#Section: base
|
||||||
|
#Priority: optional
|
||||||
|
#Architecture: amd64
|
||||||
|
#Maintainer: Shiham Abdul Rahman <shihaam@shihaam.me>
|
||||||
|
#Description: Podman container engine
|
||||||
|
# Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System.
|
||||||
|
#
|
||||||
|
#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 <<EOF > podman-deb/usr/lib/systemd/system/podman.service
|
||||||
|
#[Unit]
|
||||||
|
#Description=Podman API Service
|
||||||
|
#Requires=podman.socket
|
||||||
|
#After=podman.socket
|
||||||
|
#Documentation=man:podman-system-service(1)
|
||||||
|
#StartLimitIntervalSec=0
|
||||||
|
#
|
||||||
|
#[Service]
|
||||||
|
#Delegate=true
|
||||||
|
#Type=exec
|
||||||
|
#KillMode=process
|
||||||
|
#Environment=LOGGING="--log-level=info"
|
||||||
|
#ExecStart=/usr/bin/podman $LOGGING system service
|
||||||
|
#
|
||||||
|
#[Install]
|
||||||
|
#WantedBy=default.target
|
||||||
|
#
|
||||||
|
#EOF
|
||||||
|
#
|
||||||
|
#cat <<EOF > podman-deb/usr/lib/systemd/system/podman.socket
|
||||||
|
#[Unit]
|
||||||
|
#Description=Podman API Socket
|
||||||
|
#Documentation=man:podman-system-service(1)
|
||||||
|
#
|
||||||
|
#[Socket]
|
||||||
|
#ListenStream=%t/podman/podman.sock
|
||||||
|
#SocketMode=0660
|
||||||
|
#
|
||||||
|
#[Install]
|
||||||
|
#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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user