MAC에 Podman Desktop 설치
by 현생사는갓생지망생Podman (Pod Manager Tool) 이란?
OCI 컨테이너를 빌드하고 실행하기 위한 컨테이너 엔진
그렇다면 왜 Podman을 설치해야 할까?
👉🏻 Linux에서 구동되는 Docker Engine을 MAC와 Window에서 구동시키기 위해 VM을 생성하고, Docker를 사용하도록 도와주는 Docker Desktop이 유료화되었다.
개인 사용자는 무료로 이용할 수 있지만 회사에서 업무용으로 사용할 경우 규모에 따라 비용이 발생할 수 있다.
다만, Docker 자체가 유료화되는 것은 아니기 때문에 Docker CLI, Docker Engine 등은 기존과 동일하게 사용할 수 있다.
따라서 업무용으로 MAC 또는 Window에서 Docker를 사용할 경우 Docker Desktop의 대체재인 Podman을 사용할 수 있다.
1. MacOS용 패키지 관리자 Homebrew 설치
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Podman Desktop 설치
Podman은 QEMU 기반 가상머신의 지원을 받아야 하기 때문에 가상머신 설정
Podman에서 관리하는 QEMU로 Podman 클라이언트 연결하면 Fedora 가상머신 이미지를 내려받고, 준비가 되면 클라이언트와 연결
brew install podman-desktop
podman machine init
podman machine start
3. 환경 변수 설정
Podman Socket이 Docker와 연결되도록 Podman의 Socket 위치 찾아서 변수($DOCKER_HOST)로 지정
hyeonsaeng@MacBookPro ~ % cat ~/.zshrc
export DOCKER_HOST=unix:///Users/hyeonsaeng/.local/share/containers/podman/machine/qemu/podman.sock
hyeonsaeng@MacBookPro ~ % ls -l /var/run/docker.sock
lrwxr-xr-x@ 1 root daemon 68 Dec 15 09:54 /var/run/docker.sock -> /Users/hyeonsaeng/.local/share/containers/podman/machine/podman.sock
4. 설치 확인
docker ps 명령 실행 시 컨테이너 목록 확인 가능
hyeonsaeng@MacBookPro ~ % docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
🛠️ 에러 해결
Podman is Starting에서 계속 멈춰 있는 현상
hyeonsaeng@MacBookPro ~ % podman machine start
Starting machine "podman-machine-default"
Error: dial unix /var/folders/_d/gs33s0011rd1gd9qqnzjjnf80000gn/T/podman/qmp_podman-machine-default.sock: connect: no such file or directory
Podman Machine을 삭제 후 다시 생성한다
hyeonsaeng@MacBookPro ~ % podman machine rm
The following files will be deleted:
/Users/hyeonsaeng/.ssh/podman-machine-default
/Users/hyeonsaeng/.ssh/podman-machine-default.pub
/Users/hyeonsaeng/.config/containers/podman/machine/qemu/podman-machine-default.ign
/Users/hyeonsaeng/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-38.20230527.2.0-qemu.aarch64.qcow2
/Users/hyeonsaeng/.local/share/containers/podman/machine/qemu/podman.sock
/Users/hyeonsaeng/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd
/Users/hyeonsaeng/.config/containers/podman/machine/qemu/podman-machine-default.json
Are you sure you want to continue? [y/N] y
hyeonsaeng@MacBookPro ~ % podman machine init
Downloading VM image: fedora-coreos-38.20230722.2.1-qemu.aarch64.qcow2.xz: done
Extracting compressed file
Image resized.
Machine init complete
To start your machine run:
podman machine start
hyeonsaeng@MacBookPro ~ % podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
Mounting volume... /private:/private
Mounting volume... /var/folders:/var/folders
This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:
podman machine set --rootful
API forwarding listening on: /var/run/docker.sock
Docker API clients default to this address. You do not need to set DOCKER_HOST.
Machine "podman-machine-default" started successfully
hyeonsaeng@MacBookPro ~ % podman machine list
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* qemu About a minute ago Currently running 1 2.147GB 107.4GB
✍🏻 참고
Docker Desktop의 대체재 https://byungwoo.oopy.io/0e5485ba-dc5e-4951-a611-81ce08291817
Docker Desktop 유료화 https://www.docker.com/blog/updating-product-subscriptions/
Docker Pricing & Subscriptions https://www.docker.com/pricing/
'DevOps' 카테고리의 다른 글
Git Status와 Git Add, Commit, Push 기본 개념 및 사용법 (3) | 2023.12.21 |
---|---|
다른 사람의 GitLab Repository에서 Branch 복사해오기 (0) | 2023.12.15 |
Conflict (충돌) 없이 Git Merge 하기 (0) | 2023.12.15 |
MAC에 Git 설치 및 GitLab Remote 저장소 연동 (0) | 2023.12.15 |
Kubernetes 기본 개념과 기능 및 동작 구조 (1) | 2023.12.15 |
블로그의 정보
현생이네
현생사는갓생지망생