본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Dapr CLI 설치하기

원문 보기 위키 갱신

Dapr 관련 작업을 실행하는 주요 도구로 Dapr CLI를 설치해요.

Dapr CLI를 다양한 Dapr 관련 작업의 주요 도구로 사용하게 될 거예요. CLI로는 다음을 할 수 있어요.

  • Dapr sidecar와 함께 어플리케이션을 실행해요.
  • sidecar 로그를 확인해요.
  • 실행 중인 서비스 목록을 보여줘요.

Dapr CLI는 self-hosted 환경과 Kubernetes 환경 모두에서 동작해요.

시작하기 전에

Docker Desktop의 고급 옵션에서 기본 Docker 소켓 사용을 허용했는지 확인해요. Windows에서 WSL 통합을 사용 중이라면 이 옵션은 사용할 수 없어요.

출처: Dapr 문서

본문

1단계: Dapr CLI 설치하기

  • Linux
  • Windows
  • MacOS
  • 바이너리 (Binaries)

터미널에서 설치하기

최신 Linux Dapr CLI를 /usr/local/bin에 설치해요.

wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash

특정 CLI 버전 설치하기 다음 예제는 CLI 버전 1.18.0을 설치하는 방법이에요. 버전을 지정해서 릴리스 후보(release candidate)도 설치할 수 있어요 (예: 1.10.0-rc.3).

wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash -s 1.18.0

sudo 없이 설치하기

sudo 명령에 접근할 수 없거나 사용자 이름이 sudoers 파일에 없다면, DAPR_INSTALL_DIR 환경 변수를 통해 Dapr을 다른 디렉터리에 설치할 수 있어요. 이 디렉터리는 이미 존재해야 하고 현재 사용자가 접근할 수 있어야 해요.

wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | DAPR_INSTALL_DIR="$HOME/dapr" /bin/bash

sudo 없이 특정 CLI 버전 설치하기 다음 예제는 CLI 버전 1.18.0을 설치하는 방법이에요. 버전을 지정해서 릴리스 후보도 설치할 수 있어요 (예: 1.10.0-rc.3).

wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | DAPR_INSTALL_DIR="$HOME/dapr" /bin/bash -s 1.18.0

명령 프롬프트에서 설치하기

최신 Windows Dapr CLI를 $Env:SystemDrive\dapr에 설치하고 이 디렉터리를 사용자 PATH 환경 변수에 추가해요.

powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"

참고: PATH 변경 사항은 터미널 어플리케이션을 다시 시작하기 전에는 보이지 않을 수 있어요. 특정 CLI 버전 설치하기 다음 예제는 CLI 버전 1.18.0을 설치하는 방법이에요. 버전을 지정해서 릴리스 후보도 설치할 수 있어요 (예: 1.10.0-rc.3).

powershell -Command "$script=iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1; $block=[ScriptBlock]::Create($script); invoke-command -ScriptBlock $block -ArgumentList 1.18.0"

관리자 권한 없이 설치하기

관리자 권한이 없다면, DAPR_INSTALL_DIR 환경 변수를 통해 Dapr을 다른 디렉터리에 설치할 수 있어요. 아래 스크립트는 디렉터리가 없으면 생성해요.

$Env:DAPR_INSTALL_DIR = "<your_alt_install_dir_path>"
$script=iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1; $block=[ScriptBlock]::Create($script); invoke-command -ScriptBlock $block -ArgumentList "", "$Env:DAPR_INSTALL_DIR"

관리자 권한 없이 특정 CLI 버전 설치하기

다음 예제는 CLI 버전 1.18.0을 설치하는 방법이에요. 버전을 지정해서 릴리스 후보도 설치할 수 있어요 (예: 1.10.0-rc.3).

$Env:DAPR_INSTALL_DIR = "<your_alt_install_dir_path>"
$script=iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1; $block=[ScriptBlock]::Create($script); invoke-command -ScriptBlock $block -ArgumentList "1.18.0", "$Env:DAPR_INSTALL_DIR"

winget으로 설치하기

최신 Windows Dapr CLI를 $Env:SystemDrive\dapr에 설치하고 이 디렉터리를 사용자 PATH 환경 변수에 추가해요.

winget install Dapr.CLI

프리뷰 릴리스의 경우: 최신 프리뷰 릴리스를 설치해요.

winget install Dapr.CLI.Preview

MSI 설치 프로그램으로 설치하기

Dapr CLI의 각 릴리스에는 Windows용 설치 프로그램도 포함되어 있어요. MSI를 직접 다운로드할 수 있어요.

  • 최신 Dapr 릴리스에서 MSI 패키지 dapr.msi를 다운로드해요.
  • 다운로드한 MSI 파일로 이동한 뒤, 파일을 더블클릭해서 실행해요.
  • 설치 프롬프트에 따라 라이선스와 설치 디렉터리를 동의해요. 선택한 폴더는 사용자 PATH 환경 변수에 추가돼요. 기본값은 $Env:SystemDrive\dapr로 설정돼요.
  • 설치를 시작하려면 Install을 클릭해요. 설치가 완료되면 최종 메시지가 표시돼요.

터미널에서 설치하기

최신 Darwin Dapr CLI를 /usr/local/bin에 설치해요.

curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash

특정 CLI 버전 설치하기 다음 예제는 CLI 버전 1.18.0을 설치하는 방법이에요. 버전을 지정해서 릴리스 후보도 설치할 수 있어요 (예: 1.10.0-rc.3).

curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash -s 1.18.0

ARM64 Mac의 경우: 터미널에서 설치할 때 네이티브 ARM64 바이너리가 제공돼요. Rosetta 에뮬레이션을 설치하려면:

softwareupdate --install-rosetta

Homebrew로 설치하기

Homebrew로 설치해요.

brew install dapr/tap/dapr-cli

ARM64 Mac의 경우: ARM64 Mac에서는 Homebrew 3.0 이상 버전이 지원돼요. Homebrew를 3.0.0 이상으로 업데이트한 뒤 아래 명령을 실행해요.

arch -arm64 brew install dapr/tap/dapr-cli

sudo 없이 설치하기

sudo 명령에 접근할 수 없거나 사용자 이름이 sudoers 파일에 없다면, DAPR_INSTALL_DIR 환경 변수를 통해 Dapr을 다른 디렉터리에 설치할 수 있어요. 이 디렉터리는 이미 존재해야 하고 현재 사용자가 접근할 수 있어야 해요.

curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | DAPR_INSTALL_DIR="$HOME/dapr" /bin/bash

sudo 없이 특정 CLI 버전 설치하기 다음 예제는 CLI 버전 1.18.0을 설치하는 방법이에요. 버전을 지정해서 릴리스 후보도 설치할 수 있어요 (예: 1.10.0-rc.3).

curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | DAPR_INSTALL_DIR="$HOME/dapr" -s 1.18.0

각 Dapr CLI 릴리스는 다양한 OS와 아키텍처를 포함해요. 이러한 바이너리 버전을 직접 다운로드해서 설치할 수 있어요.

  • 최신 Dapr Release에서 원하는 Dapr CLI를 다운로드해요.
  • 압축을 풀어요 (예: dapr_linux_amd64.tar.gz, dapr_windows_amd64.zip).
  • 원하는 위치로 이동해요. Linux/MacOS의 경우 /usr/local/bin을 추천해요.
  • Windows의 경우 디렉터리를 만들고 이를 시스템 PATH에 추가해요. 예: C:\dapr라는 디렉터리를 만들어요.
  • 시스템 환경 변수 편집을 통해 새로 만든 디렉터리를 사용자 PATH에 추가해요.

2단계: 설치 확인하기

터미널/명령 프롬프트를 다시 시작하고 다음을 실행해서 CLI가 설치됐는지 확인해요.

dapr -h

출력:

__
____/ /___ _____ _____
/ __ / __ '/ __ \/ ___/
/ /_/ / /_/ / /_/ / /
\__,_/\__,_/ .___/_/
/_/

===============================
Distributed Application Runtime

Usage:
dapr [command]

Available Commands:
completion Generates shell completion scripts
components List all Dapr components. Supported platforms: Kubernetes
configurations List all Dapr configurations. Supported platforms: Kubernetes
help Help about any command
init Install Dapr on supported hosting platforms. Supported platforms: Kubernetes and self-hosted
invoke Invoke a method on a given Dapr application. Supported platforms: Self-hosted
list List all Dapr instances. Supported platforms: Kubernetes and self-hosted
logs Get Dapr sidecar logs for an application. Supported platforms: Kubernetes
mtls Check if mTLS is enabled. Supported platforms: Kubernetes
publish Publish a pub-sub event. Supported platforms: Self-hosted
run Run Dapr and (optionally) your application side by side. Supported platforms: Self-hosted
status Show the health status of Dapr services. Supported platforms: Kubernetes
stop Stop Dapr instances and their associated apps. . Supported platforms: Self-hosted
uninstall Uninstall Dapr runtime. Supported platforms: Kubernetes and self-hosted
upgrade Upgrades a Dapr control plane installation in a cluster. Supported platforms: Kubernetes
version Print the Dapr runtime and CLI version

Flags:
-h, --help help for dapr
-v, --version version for dapr

Use "dapr [command] --help" for more information about a command.

다음 단계: Dapr 초기화하기 >>

더 알아보기 (Learn more)