-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallDocker
More file actions
28 lines (21 loc) · 928 Bytes
/
installDocker
File metadata and controls
28 lines (21 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -e
# 1️⃣ 환경 변수
DOCKER_GPG_ASC_URL="https://download.docker.com/linux/ubuntu/gpg"
DOCKER_KEYRING="/usr/share/keyrings/docker-archive-keyring.gpg"
DOCKER_LIST="/etc/apt/sources.list.d/docker.list"
# 2️⃣ 필수 패키지 설치
sudo apt update
sudo apt install -y curl gnupg lsb-release
# 3️⃣ GPG 키 다운로드 및 변환
curl -fsSL $DOCKER_GPG_ASC_URL -o docker.asc
sudo gpg --dearmor -o $DOCKER_KEYRING docker.asc
rm docker.asc
# 4️⃣ Docker 저장소 추가
echo "deb [arch=$(dpkg --print-architecture) signed-by=$DOCKER_KEYRING] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee $DOCKER_LIST > /dev/null
# 5️⃣ 패키지 목록 업데이트 및 Docker 설치
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# 6️⃣ 설치 확인
docker --version
echo "Docker 설치 완료!"