Podman(Rocky Linux 9)
# dnf -y update# dnf -y upgrade-> 패키지 목록 새로고침 및 업데이트 적용# dnf -y install podmanpodman 패키지 설치# podman -v-> 버전 확인# podman search nginx- 이미지 검색 & 다운받기# podman pull docker.io/library/nginx:latest
# dnf -y update# dnf -y upgrade-> 패키지 목록 새로고침 및 업데이트 적용
# dnf -y install podmanpodman 패키지 설치
# podman -v-> 버전 확인
# podman search nginx- 이미지 검색 & 다운받기
# podman pull docker.io/library/nginx:latest-> nginx 최신버전 다운로드
# podman images-> 이미지 목록 보기
# podman run -d --name mynginx -p 8082:80 nginx:latest-> 컨테이너 실행
-d : 백그라운드 실행
--name mynginx : 컨테이너 이름
-p : 8082:80 : 컨테이너 80 포트 매핑
# podman ps-> 실행 중인 컨테이너
# podman ps -a-> 종료된 것 포함 전체
# podman logs mynginx-> 로그
# podman exec -it mynginx /bin/bash-> 컨테이너 쉘 접속
#podman stop 컨테이너 이름-> 정지
# podman start 컨테이너 이름-> 다시 시작
# podman rm 컨테이너 이름-> 삭제
# podman rmi nginx:latest-> 이미지 삭제
# podman system prune-> 중지 컨테이너, 안 쓰는 이미지 등 삭제
# rootless로 실행하는 방법계정생성
podmantest로 계정생성
# usermod --add-subuids 100000-165535 podmantest# usermod --add-subgids 100000-165535 podmantest-> 사용자에 subuid/subgid 범위 추가
# su - podmantest로 일반사용자 로그인
# podman run -d --name mynginx-rootless -p 8082:80 docker.io/library/nginx:latest-> rootless 컨테이너 실행
# podman ps-> 상태 확인
# curl http://서버IP:8082/-> 접속 상태 확인
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href=" http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href=" http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
위와 같이 nginx 기본 화면이 뜬다면 성공
root에서
# loginctl enable-linger podmantest-> 일반사용자로 로그인 안해도 돌아가게 설정