How to install Docker on mac (using colima)
커맨드라인에서 설치와 다운로드하여 설치하는 여러가지 방법이 있다.
설치형은 UI가 자리잡고 있어서 개인적으로 불편했다.
여기서는 커맨드 라인에서 설치하는 colima를 기준으로 설명한다.
Colima
Docker CLI + Docker Machine + VirtualBox
Containerd & Lima
Rancher Desktop
Podman
Minikube + Hyperkit
Colima로 설치하기
brew install colima
brew install docker docker-compose
mkdir -p ~/.docker/cli-plugins
ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
Clima 실행
colima start
## GB단위 설정
colima start --cpu 4 --memory 4 --disk 100
## 전체설정
colima start --profile x64 --arch x86_64 --cpu 8 --memory 8 --disk 128 --mount '~/mydata/docker-compose:w' --dns 8.8.8.8
## or
colima start --profile x64 --arch x86_64 --cpu 8 --memory 8 --disk 128 --mount-type 9p --dns 8.8.8.8 --network-address
디스크 권한 이슈
# 인스턴스 삭제
colima delete
# 설정파일 오버라이드
touch ~/.lima/_config/override.yaml
# 파일내용추가
echo 'mountType: 9p
mounts:
- location: "/Users/권한설정할폴더명"
writable: true
9p:
securityModel: mapped-xattr
cache: mmap
- location: /tmp/colima
writable: true
9p:
securityModel: mapped-xattr
cache: mmaptest
' >> ~/.lima/_config/override.yaml
colima start --mount-type 9p
Test Docker
docker run hello-word
결론
Colima는 무료로 오픈 컨테이너 런타임을 제공하며 공식 클라이언트와 동일하다.
Ref :