Compare commits

...

23 Commits

Author SHA1 Message Date
893bdb451c containernetworking-plugins 2023-02-28 19:53:02 +05:00
7bd28ef95e non-systemd 2023-02-28 19:44:47 +05:00
3e5cb4ee80 slirp4netns 2023-02-28 19:43:15 +05:00
fff996a787 uidmap 2023-02-28 19:24:17 +05:00
01eaa2f30a updated readme 2023-02-28 19:02:01 +05:00
e04423c21c comments 2023-02-28 18:57:25 +05:00
93725b5cc0 /usr/local/bin/ 2023-02-28 18:47:18 +05:00
53c0b3ca0b LOGGING=--log-level=info 2023-02-28 18:45:51 +05:00
d9b2df3f62 purge 2023-02-28 18:41:27 +05:00
fd08c24e4a just build it 2023-02-28 18:40:36 +05:00
ef6fe370e5 repare for build 2023-02-28 18:32:29 +05:00
3518990c29 podman 2023-02-28 18:24:02 +05:00
168ccdd3e8 update 2023-02-28 17:53:20 +05:00
2b286d7d75 fresh start again, 1 step at a time this is go 2023-02-28 17:51:14 +05:00
15ee256519 i give up, this doesnt work 2023-02-28 17:37:56 +05:00
50c2104d96 goo 2023-02-28 17:23:23 +05:00
3133f1718b CNI plugins and some comments 2023-02-28 17:03:59 +05:00
ae7c6bea88 --no-install-recommends 2023-02-28 16:52:37 +05:00
e5e0352df5 - 2023-02-28 16:49:17 +05:00
a6701e15ec a clean start 2023-02-28 16:47:57 +05:00
5487f4133c go get 2023-02-28 16:36:03 +05:00
17ca5e1776 ubuntu now 2023-02-28 16:25:23 +05:00
acfd63f3e3 ffs typo 2023-02-28 16:14:50 +05:00
7 changed files with 154 additions and 139 deletions

View File

@@ -6,7 +6,7 @@
```bash
git clone git@gitlab.com:alliedmaldives/ops/podmanbuilder.git
cd podmanbuilder
./build.sh
docker compose run --rm podman-builder bash -c 'bash /root/podman-build.sh'
```
- you should have the .deb file in a folder called 'build'

View File

@@ -1,10 +0,0 @@
#!/bin/bash
docker compose -f ubuntu-docker-compose.yml\
run --rm podman-builder \
/bin/bash -c 'bash /root/pomanbin-build.sh'
docker compose -f debian-docker-compose.yml\
run --rm podman-builder \
/bin/bash -c 'bash /root/podmandeb-build.sh'

View File

@@ -1,11 +0,0 @@
version: '3.5'
services:
#########################
podman-builder:
hostname: podman-builder
image: debian
working_dir: /root/
volumes:
- ./build:/root/build
- ./podmandeb-build.sh:/root/podmandeb-build.sh
command: bash /root/podmandeb-build.sh

View File

@@ -3,9 +3,9 @@ services:
#########################
podman-builder:
hostname: podman-builder
image: ubuntu
image: debian:11
working_dir: /root/
volumes:
- ./build:/root/build
- ./pomanbin-build.sh:/root/pomanbin-build.sh
command: bash /root/pomanbin-build.sh
- ./podman-build.sh:/root/podman-build.sh
command: bash /root/podman-build.sh

150
podman-build.sh Normal file
View File

@@ -0,0 +1,150 @@
#!/bin/bash
cd /root/
apt update
apt install -y \
btrfs-progs \
curl \
gcc \
git \
iptables \
libassuan-dev \
libbtrfs-dev \
libc6-dev \
libdevmapper-dev \
libglib2.0-dev \
libgpg-error-dev \
libgpgme-dev \
libprotobuf-c-dev \
libprotobuf-dev \
libseccomp-dev \
libselinux1-dev \
libsystemd-dev \
make \
pkg-config \
runc \
uidmap
apt install --no-install-recommends -y libapparmor-dev libsystemd-dev wget curl make ca-certificates
wget https://storage.googleapis.com/golang/getgo/installer_linux
chmod +x ./installer_linux
./installer_linux
PATH=$PATH:$HOME/.go/bin
export PATH
#source ~/.bash_profile
# make conmon
git clone https://github.com/containers/conmon
cd conmon
export GOCACHE="$(mktemp -d)"
make
cp -vr ./bin ~/build/
cd ~
# make runc
git clone https://github.com/opencontainers/runc.git $GOPATH/src/github.com/opencontainers/runc
cd $GOPATH/src/github.com/opencontainers/runc
make BUILDTAGS="selinux seccomp"
cp -v runc ~/build/
cp ~
# make podman
PODMAN_VERSION=$(curl -s https://api.github.com/repos/containers/podman/releases/latest|grep tag_name|cut -d '"' -f 4)
git clone https://github.com/containers/podman.git podman-$PODMAN_VERSION
cd podman-$PODMAN_VERSION
git checkout tags/$PODMAN_VERSION
#make BUILDTAGS="selinux seccomp" #non systemd
make ENABLE_BUILDTAGS="systemd" binaries
cp -vr ./bin ~/build/
cd ~
## prepare for packging
mkdir -p podman-deb
## remove v in version name
PODMAN_NOV_VERSION=$(echo $PODMAN_VERSION | sed s/v//)
#
mkdir -p podman-deb/DEBIAN
cat <<EOF > podman-deb/DEBIAN/control
Package: podman
Version: $PODMAN_NOV_VERSION
Depends: libgpgme11,uidmap,slirp4netns,containernetworking-plugins
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/
#
# podman.service
LOGGING="--log-level=info"
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/local/bin/podman $LOGGING system service
[Install]
WantedBy=default.target
EOF
# podman.socket
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/
## runc
mkdir -p podman-deb/usr/bin
cp -v build/runc podman-deb/usr/bin
## conmon
mkdir -p podman-deb/usr/bin
cp -v build/bin/conmon podman-deb/usr/bin/
## ofc the permission
chmod 755 podman-deb/usr/local/bin/*
chmod 755 podman-deb/usr/bin/*
## Finally build the .deb
dpkg-deb --build podman-deb build

View File

@@ -1,74 +0,0 @@
#!/bin/bash
cd /root/
apt update
apt upgrade -y
apt install -y jq wget curl make
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 <<EOF > podman-deb/DEBIAN/control
Package: podman
Version: $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
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
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/*
dpkg-deb --build podman-deb build

View File

@@ -1,40 +0,0 @@
#!/bin/bash
cd /root/
apt update
apt upgrade -y
apt-get install -y \
btrfs-progs \
crun \
git \
golang-go \
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
apt install -y jq wget curl make
VERSION=$(curl -s https://api.github.com/repos/containers/podman/releases/latest | jq '.name' -r)
export VERSION
git clone https://github.com/containers/podman.git podman-$VERSION
cd podman-$VERSION
git checkout tags/$VERSION
make ENABLE_BUILDTAGS="systemd" binaries
cp -vr bin/ ../build