Podman [edit]

Install [edit]

# dnf module install container-tools -y 
# dnf install podman -y
# dnf install podman-docker -y
# dnf install podman-remote -y
# dnf install podman-plugins -y
CentOS7 に v3 をインストールする(通常は v1.6.4 : 2021 9/18) [edit]
# yum install podman -y
# yum install podman-docker -y
# yum install podman-remote -y
# yum install podman-plugins -y
# podman --version
podman version 3.0.1

API用設定 [edit]

adduser podman 
passwd podman
chgrp podman /var/run/podman  (再起動したら元に戻ってしまう)
chmod g+rwxs /var/run/podman (同上)
systemctl start podman.socket

Skopeo [edit]

Buildah [edit]

Docker 互換 [edit]

podman-compose [edit]

INSTALL [edit]
(base) # pip --no-cache install podman-compose

API [edit]

systemctl daemon-reload
systemctl enable podman.socket
systemctl start podman.socket

共有 [edit]

ファイル(Volume)共有 [edit]

Tips [edit]

知らない所で蠢くヤツら [edit]

Local Registory [edit]

作成 [edit]
mkdir -p /var/lib/registry
podman run --privileged -d --name registry -p 5000:5000 -v /var/lib/registry:/var/lib/registry --restart=always registry:2
vi /etc/containers/registries.conf                 registries に 'localhost:5000' を追加.最後が良い
Push [edit]
podman tag localhost/jupyterhub/singleuser-ltids localhost:5000/jupyterhub/singleuser-ltids
podman push localhost:5000/jupyterhub/singleuser-ltids --tls-verify=false
Pull [edit]
podman pull localhost:5000/jupyterhub/singleuser-ltids --tls-verify=false

Trouble Shooting [edit]

あるユーザの環境で動かない [edit]
error adding seccomp filter rule for syscall bdflush: requested action matches default action of filter [edit]
user namespaces are not enabled in /proc/sys/user/max_user_namespaces(CentOS7) [edit]
Error: Could not get runtime: kernel does not support overlay fs [edit]
the backing xfs filesystem is formatted without d_type support [edit]
Failed to allocate manager object: Permission denied [edit]
Docker を入れてから削除し,再び Podman を入れようとしたら駄目だった [edit]
Error: could not get runtime: error creating tmpdir /run/user/1000/libpod/tmp: mkdir /run/user/1000: permission denied [edit]

Devel [edit]

PodmanSpawner [edit]

podman run -d --net host
-v /home/teacher/iseki:/home/iseki/
-v /mnt/datahdd:/extdata 
-w /home/iseki/
--hooks-dir /usr/share/containers/oci/hooks.d/ 
-e NVIDIA_VISIBLE_DEVICES=all
docker.io/jupyterhub/singleuser
jupyterhub-singleuser 
--NotebookApp.port=42868 
--allow-root 
podman run -d --net host
-v /home/bob:/home/jovyan/home 
-v /mnt/datahdd:/exdata
docker.io/jupyterhub/singleuser
start-notebook.sh
--NotebookApp.port=50377

コマンド例 [edit]

podman run -d --net host -v /home/teacher/iseki:/home/iseki/ -w /home/iseki/ 
--env JUPYTERHUB_API_TOKEN=cf30aa5ab007444ca6462ff8c4decfec 
--env JPY_API_TOKEN=cf30aa5ab007444ca6462ff8c4decfec 
--env JUPYTERHUB_CLIENT_ID=jupyterhub-user-iseki 
--env JUPYTERHUB_HOST= 
--env JUPYTERHUB_OAUTH_CALLBACK_URL=/user/iseki/oauth_callback 
--env JUPYTERHUB_USER=iseki 
--env JUPYTERHUB_SERVER_NAME= 
--env JUPYTERHUB_API_URL=http://202.26.150.118:8081/hub/api 
--env JUPYTERHUB_ACTIVITY_URL=http://202.26.150.118:8081/hub/api/users/iseki/activity 
--env JUPYTERHUB_BASE_URL=/ 
--env JUPYTERHUB_SERVICE_PREFIX=/user/iseki/ 
--env GRANT_SUDO=no 
--env CHOWN_HOME=yes 
--env PRJCT_DIR=jupyter 
--env WORK_DIR=works 
--env COURSE_DIR=.courses 
--env NB_UMASK=0037 
--env CONDA_DIR=/opt/conda 
--env TZ=JST-9 
--env JUPYTER_ENABLE_LAB=yes 
--env JUPYTER_IMAGE_SPEC=docker.io/jupyterhub/singleuser 
-v /mnt/datahdd:/extdata 
--hooks-dir /usr/share/containers/oci/hooks.d/ 
-e NVIDIA_VISIBLE_DEVICES=all
docker.io/jupyterhub/singleuser jupyterhub-singleuser 
--NotebookApp.port=42868 
--allow-root 
--ip=0.0.0.0
podman run -d --net host -v /home/bob:/home/jovyan/home 
--env JUPYTERHUB_API_TOKEN=7807b43805c442f4b38b1a89855df831 
--env JPY_API_TOKEN=7807b43805c442f4b38b1a89855df831 
--env JUPYTERHUB_CLIENT_ID=jupyterhub-user-bob
--env JUPYTERHUB_HOST=
--env JUPYTERHUB_OAUTH_CALLBACK_URL=/user/bob/oauth_callback
--env JUPYTERHUB_USER=bob
--env JUPYTERHUB_SERVER_NAME=
--env JUPYTERHUB_API_URL=http://202.26.150.118:8081/hub/api
--env JUPYTERHUB_ACTIVITY_URL=http://202.26.150.118:8081/hub/api/users/bob/activity
--env JUPYTERHUB_BASE_URL=/
--env JUPYTERHUB_SERVICE_PREFIX=/user/bob/
--env GRANT_SUDO=no
--env CHOWN_HOME=yes
--env PRJCT_DIR=jupyter
--env WORK_DIR=works
--env COURSE_DIR=.courses
--env NB_UMASK=0037
--env CONDA_DIR=/opt/conda
--env TZ=JST-9
--env JUPYTER_ENABLE_LAB=yes
--env JUPYTER_IMAGE_SPEC=docker.io/jupyterhub/singleuser
-v /mnt/datahdd:/exdata docker.io/jupyterhub/singleuser
start-notebook.sh
--NotebookApp.port=50377

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 ページ一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-08-29 (火) 11:45:21