w1100n
This site is best viewed in Google Chrome
1/19/2020 23:30

sudo pacman -S podman

podman unshare cat /proc/self/uid_map
unshare -U

podman ps
podman ps -f  name=zookeeper
podman ps -a --format "{{.ID}} {{.Names}}"
podman ps -a
podman inspect -l
podman logs --latest
podman top <container_id>
podman container checkpoint <container_id>
podman container restore <container_id>

podman stop --latest
podman rm --latest

registry config

/etc/containers/registries.conf

[registries.search]
registries = ['foo.mirror.aliyuncs.com','docker.io', 'registry.fedoraproject.org']

rootless

yay -S crun
usr/share/containers/libpod.conf — runtime=”crun”

sudo touch /etc/subuid
sudo touch /etc/subgid
sudo usermod –add-subuids 10000-65536 user0
sudo usermod –add-subgids 10000-65536 user0
getcap /usr/bin/newuidmap
getcap /usr/bin/newgidmap

podman run \
-d \
--name name0 \
-p 2000:80/tcp \
-v /etc/localtime:/etc/localtime:ro \
--restart=always \
image0_name

# generate systemd script
podman generate systemd container0 > /usr/lib/systemd/system/container0service

network

podman network  create --driver bridge net0
podman network create --driver bridge --subnet 172.22.16.0/24 --gateway 172.22.16.1 net0
podman network ls
podman network inspect net0

podman run -it --network=net0 busybox
# 指定ip
podman run -it --network=net0 --ip 172.22.16.8 busybox

https://www.hangge.com/blog/cache/detail_2475.html
https://www.mankier.com/1/podman-unshare
https://opensource.com/article/19/2/how-does-rootless-podman-work
https://www.mankier.com/1/podman-generate-systemd

<< Previous Posts Newer Posts >>
辽ICP备14012896