Skip to content

Commit 2285b3d

Browse files
committed
chore(stacks): build rootless podman
1 parent 60657e8 commit 2285b3d

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

stacks/podman/build.sh

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ function build() {
1010
fuse-overlayfs
1111
iptables
1212
conmon
13+
uidmap
14+
slirp4netns
1315
EOF
1416

1517
install-packages \
@@ -42,6 +44,10 @@ EOF
4244
curl -fsSL -o tmp.tar.gz https://github.com/containers/podman/archive/refs/tags/v${STACK_VERSION}.tar.gz
4345
tar -xzf tmp.tar.gz && rm tmp.tar.gz
4446
cd podman-${STACK_VERSION}
47+
48+
49+
sed -i "s#/etc/containers#/opt/drycc/podman/etc/containers#g" `grep /etc/containers -rl .`
50+
4551
PREFIX=/opt/drycc/podman make BUILDTAGS="seccomp"
4652
PREFIX=/opt/drycc/podman make install
4753
cd /workspace
@@ -59,22 +65,12 @@ EOF
5965
rm tmp.tar.gz
6066
cd -
6167

62-
mv /opt/drycc/podman/bin/podman /opt/drycc/podman/bin/podman-original
63-
cat << EOF > "/opt/drycc/podman/bin/podman"
64-
if [ ! -d "/opt/cni" ];then
65-
ln -s /opt/drycc/podman/opt/cni /opt/cni
66-
fi
67-
68-
if [ ! -d "/etc/containers" ];then
69-
ln -s /opt/drycc/podman/etc/containers /etc/containers
70-
fi
71-
exec /opt/drycc/podman/bin/podman-original --runtime /opt/drycc/podman/bin/crun "\$@"
72-
EOF
7368
chmod +x /opt/drycc/podman/bin/podman
7469
mkdir -p /opt/drycc/podman/etc/containers
7570
mkdir -p /opt/drycc/podman/run/containers/storage
7671
mkdir -p /opt/drycc/podman/var/lib/containers/storage
7772
mkdir -p /opt/drycc/podman/var/lib/shared
73+
mkdir -p /opt/drycc/podman/etc/cni/net.d
7874

7975
cat << EOF > "/opt/drycc/podman/etc/containers/storage.conf"
8076
[storage]
@@ -86,8 +82,22 @@ additionalimagestores = [
8682
"/opt/drycc/podman/var/lib/shared",
8783
]
8884
[storage.options.overlay]
85+
ignore_chown_errors = "true"
8986
mount_program = "/usr/bin/fuse-overlayfs"
9087
mountopt = "nodev,fsync=0"
88+
EOF
89+
90+
cat << EOF > "/opt/drycc/podman/etc/containers/containers.conf"
91+
[containers]
92+
netns="private"
93+
94+
[network]
95+
cni_plugin_dir="/opt/drycc/podman/opt/cni"
96+
network_config_dir="/opt/drycc/podman/etc/cni/net.d/"
97+
default_network="podman"
98+
99+
[engine]
100+
runtime="/opt/drycc/podman/bin/crun"
91101
EOF
92102

93103
curl -L -o /opt/drycc/podman/etc/containers/registries.conf https://src.fedoraproject.org/rpms/containers-common/raw/main/f/registries.conf

0 commit comments

Comments
 (0)