unifios-utilities/podman-update/01-podman-update.sh

50 lines
1.7 KiB
Bash
Raw Normal View History

2021-05-25 12:24:44 +00:00
#!/bin/sh
2021-05-25 12:40:13 +00:00
mkdir -p /mnt/data/.cache
2021-05-25 12:24:44 +00:00
2021-08-26 08:36:56 +00:00
PODMAN_VERSION=3.3.0
RUNC_VERSION=1.0.2
CONMON_VERSION=2.0.29
2021-05-25 14:23:14 +00:00
PODMAN_DL=/mnt/data/.cache/podman-$PODMAN_VERSION
RUNC_DL=/mnt/data/.cache/runc-$RUNC_VERSION
CONMON_DL=/mnt/data/.cache/conmon-$CONMON_VERSION
SECCOMP=/usr/share/containers/seccomp.json
2021-05-25 12:24:44 +00:00
2021-05-25 17:13:58 +00:00
while [ ! -f $CONMON_DL ]; do
curl -fsSLo $CONMON_DL https://github.com/unifi-utilities/unifios-utilities/blob/main/podman-update/bin/conmon-$CONMON_VERSION?raw=true
2021-05-25 17:13:58 +00:00
sleep 1
done
2021-05-25 12:24:44 +00:00
chmod +x $CONMON_DL
2021-05-25 14:23:14 +00:00
if [ ! -f /usr/libexec/podman/conmon.old ]; then
mv /usr/libexec/podman/conmon /usr/libexec/podman/conmon.old
fi
2021-05-25 12:24:44 +00:00
ln -s $CONMON_DL /usr/libexec/podman/conmon
if [ ! -f $PODMAN_DL ]; then
curl -fsSLo $PODMAN_DL https://github.com/unifi-utilities/unifios-utilities/blob/main/podman-update/bin/podman-$PODMAN_VERSION?raw=true
2021-05-25 12:24:44 +00:00
fi
chmod +x $PODMAN_DL
2021-05-25 14:23:14 +00:00
if [ ! -f /usr/bin/podman.old ]; then
mv /usr/bin/podman /usr/bin/podman.old
fi
2021-05-25 12:40:13 +00:00
ln -s $PODMAN_DL /usr/bin/podman
2021-05-25 12:24:44 +00:00
2021-05-25 14:23:14 +00:00
if [ ! -f $RUNC_DL ]; then
curl -fsSLo $RUNC_DL https://github.com/unifi-utilities/unifios-utilities/blob/main/podman-update/bin/runc-$RUNC_VERSION?raw=true
2021-05-25 14:23:14 +00:00
fi
chmod +x $RUNC_DL
if [ ! -f /usr/bin/runc.old ]; then
mv /usr/bin/runc /usr/bin/runc.old
fi
ln -s $RUNC_DL /usr/bin/runc
2021-05-25 12:24:44 +00:00
if [ ! -f $SECCOMP ]; then
mkdir -p /usr/share/containers/
curl -fsSLo $SECCOMP https://github.com/unifi-utilities/unifios-utilities/blob/main/podman-update/bin/seccomp.json?raw=true
2021-05-25 12:24:44 +00:00
fi
2021-05-25 12:40:13 +00:00
sed -i 's/driver = ""/driver = "overlay"/' /etc/containers/storage.conf
2021-09-07 21:29:27 +00:00
sed -i 's/ostree_repo = ""/#ostree_repo = ""/' /etc/containers/storage.conf
2021-05-25 12:40:13 +00:00
# Comment out if you don't want to enable docker-compose or remote docker admin
2021-08-26 08:36:56 +00:00
/usr/bin/podman system service --time=0 tcp:0.0.0.0:2375 &
2021-08-26 08:39:03 +00:00