Podman rootless 설치

Sbae·2023년 8월 10일
0
post-thumbnail

podman rootless 설치

  • podman을 rootless mode로 변경할 수는 있어도 처음부터 rootless로 설치는 불가능해보인다.
  • 아니면 git을 직접받아와서 설치하면 가능할수도?

podman 설치

sudo apt-get update
sudo apt-get install -y podman

podman git 설치(안해봄)

git clone https://github.com/containers/podman.git
cd podman
make
sudo make install

echo "export PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc
echo "export CONTAINER_USER=$USER" >> ~/.bashrc
source ~/.bashrc

root podman 비활성화

sudo systemctl stop podman.service
sudo systemctl stop podman.socket
sudo systemctl disable podman.service
sudo systemctl disable podman.socket

rootless mode

user에서 podman 실행

systemctl --user start podman.service
systemctl --user start podman.token
systemctl --user enable podman.service
systemctl --user enable podman.token

podman 실행 테스트

$ podman pull nginx
Error: short-name "nginx" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"

/etc/containers/registries.conf에 아래와 같이 여러 레포지토리를 추가하는 방법 아니면

[registries.search]
registries = ['docker.io']

레포지토리 경로까지 적어주는 방법이 있다.

$ podman pull docker.io/library/nginx

만약 sudo를 이용하여 nginx 이미지를 당겼다고해도 ubuntu 계정에서 podman images 명령어를 실행하면 보이지 않는 것을 확인할 수 있다.

User 확인

podman-root

podman-user

podman-ps

profile
끄적이는 일반인

0개의 댓글