Last active
July 11, 2024 10:35
-
-
Save leiless/43233485a45c5bc0203292a1c3d00418 to your computer and use it in GitHub Desktop.
HOWTO install podman in Armbian Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Install podman | |
# https://podman.io/getting-started/installation#ubuntu | |
. /etc/os-release | |
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list | |
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install podman | |
# 2. Install missing dependencies | |
sudo apt-get install -y uidmap fuse-overlayfs slirp4netns | |
# 3. Install cni-plugins | |
# https://github.com/containernetworking/plugins/releases | |
# Or sudo apt-get install -y containernetworking-plugins | |
sudo mkdir -p /usr/local/lib/cni | |
sudo tar xf cni-plugins-linux-arm64-v1.0.1.tgz -C /usr/local/lib/cni | |
ls -l /usr/local/lib/cni | |
# 4. Make an alias | |
sudo ln -s "$(which podman)" "$(dirname "$(which podman)")/docker" |
$ sudo apt install -y podman
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
catatonit conmon containers-common criu crun dnsmasq-base iptables libgpgme11 libidn11 libip6tc2 libnet1
libnetfilter-conntrack3 libnfnetlink0 libnftnl11 libprotobuf-c1 libprotobuf17 libyajl2 podman-machine-cni
podman-plugins python3-protobuf
Suggested packages:
firewalld nftables
Recommended packages:
dns-root-data slirp4netns containernetworking-plugins uidmap fuse-overlayfs
The following NEW packages will be installed:
catatonit conmon containers-common criu crun dnsmasq-base iptables libgpgme11 libidn11 libip6tc2 libnet1
libnetfilter-conntrack3 libnfnetlink0 libnftnl11 libprotobuf-c1 libprotobuf17 libyajl2 podman podman-machine-cni
podman-plugins python3-protobuf
0 upgraded, 21 newly installed, 0 to remove and 1 not upgraded.
Need to get 20.6 MB of archives.
Final solution:
sudo apt install -y podman dns-root-data slirp4netns containernetworking-plugins uidmap fuse-overlayfs
dns-root-data
is optional, but recommended
armbian/build
diff
git clone -b v21.08 --depth 1 https://github.com/armbian/build
./compile.sh docker BOARD=nanopi-r4s BRANCH=current RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,img,xz DOWNLOAD_MIRROR=china MAINLINE_MIRROR=tuna EXTRAWIFI=no WIREGUARD=no AUFS=no
diff --git a/config/templates/Dockerfile b/config/templates/Dockerfile
index 666ac7e..ae81622 100644
--- a/config/templates/Dockerfile
+++ b/config/templates/Dockerfile
@@ -1,6 +1,7 @@
FROM ubuntu:21.04
ARG DEBIAN_FRONTEND=noninteractive
-RUN apt-get update && apt-get -y install \
+RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
+ apt-get update && apt-get -y install \
joe \
software-properties-common \
gnupg \
diff --git a/config/templates/config-docker.conf b/config/templates/config-docker.conf
index 945b6de..a49ca9b 100644
--- a/config/templates/config-docker.conf
+++ b/config/templates/config-docker.conf
@@ -39,7 +39,8 @@ DOCKER_FLAGS+=(--cap-add=SYS_ADMIN --cap-add=MKNOD --cap-add=SYS_PTRACE)
# mounting things inside the container on Ubuntu won't work without this
# https://github.com/moby/moby/issues/16429#issuecomment-217126586
-DOCKER_FLAGS+=(--security-opt=apparmor:unconfined)
+#DOCKER_FLAGS+=(--security-opt=apparmor:unconfined)
+DOCKER_FLAGS+=(--security-opt label=disable)
# remove resulting container after exit to minimize clutter
# bad side effect - named volumes are considered not attached to anything and are removed on "docker volume prune"
Sometimes when you met the SHASUM hash mismatch, you would like to download the deb
directly.
Get:20 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04 podman 100:3.4.2-1 [17.7 MB]
Err:20 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04 podman 100:3.4.2-1
File has unexpected size (17679080 != 17706544). Mirror sync in progress? [IP: 130.236.254.253 443]
Hashes of expected file:
- SHA256:4eb9b58413f602cf18ec21a742acd99ae10e71df467e7b9a63c3b1f7e8229f16
- SHA1:cf1fefe5c85321fe9b562339a79494c9eda9dd60 [weak]
- MD5Sum:58fa232055dff2700aa55e13c7932536 [weak]
- Filesize:17706544 [weak]
...
E: Failed to fetch https://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/amd64/podman_3.4.2-1_amd64.deb File has unexpected size (17679080 != 17706544). Mirror sync in progress? [IP: 130.236.254.253 443]
Hashes of expected file:
- SHA256:4eb9b58413f602cf18ec21a742acd99ae10e71df467e7b9a63c3b1f7e8229f16
- SHA1:cf1fefe5c85321fe9b562339a79494c9eda9dd60 [weak]
- MD5Sum:58fa232055dff2700aa55e13c7932536 [weak]
- Filesize:17706544 [weak]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Like:
https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/amd64/podman_3.4.2-1_amd64.deb.mirrorlist
Download from original source(not from the mirror): https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/amd64/podman_3.4.2-1_amd64.deb
curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/amd64/podman_3.4.2-1_amd64.deb
sudo apt install -y ./podman_3.4.2-1_amd64.deb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References
https://podman.io/getting-started/installation#ubuntu
https://github.com/containernetworking/plugins/releases
https://medium.com/@liuyutong2921/network-failed-to-find-plugin-bridge-in-path-opt-cni-bin-70e7156ceb0b