공부합시다!/Container

PODMAN 일반적인 사용법

간서치 2022. 12. 13. 00:11
728x90

podman의 일반적인 사용법은 docker와 크게 차이점이 없습니다.

리포지토리를 지정하지 않으면 docker.io를 기본적으로 사용하게 됩니다.

 

그럼 docker 처럼 사용해 보겠습니다.

1. Install

 1.1. Cento7.4이후 버전에는 기본적으로 별다른 작업 없이 설치가 가능합니다.

# yum install -y podman

설치

 

2. 도움말 확인

 2.1. 도움말을 확인해보면 docker와 거의 흡사함을 알수 있습니다.

# podman --help

help

 

3. apache image 가져오기

 3.1. pull 명령어을 이용해 image를 가져옵니다.

 3.2. 확인을 해보면 docker.io를 사용함을 확인할 수 있습니다.

# podman pull httpd
# podman images

httpd pull및 image 확인

 

4. alpine image 가져오기

 4.1. pull 명령어을 이용해 alpine image를 가져옵니다.

 4.2. 역시 확인을 해보면 docker.io를 사용함을 확인할 수 있습니다.

alpine pull 및 이미지 확인

 

5. alpine

 5.1. alpine image 실행

# podman run -itd --name a1 alpine

 5.2. alpine container 접속

# podman attach a1

alpine images실행 및 container접속

 

6. httpd

 6.1. httpd image 실행

# podman run -itd -p 60080:80 --name h1 httpd

 6.2. httpd container 접속

httpd image 실행
httpd container 접속

 

7. Container 삭제

 7.1. 생성한 Container를 삭제합니다.

# podman rm -f $(podman ps -aq)

container 삭제

Docker랑 별 차이도 없는데!
드디어 K8S에서 사용하는 POD란 개념이 등장합니다.

기대 하세요!

728x90