-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.sh
34 lines (25 loc) · 1.04 KB
/
docker.sh
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
28
29
30
31
32
33
34
#!/bin/bash
# 패키지 업데이트 및 의존성 설치
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
# Docker의 공식 GPG 키 추가
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Docker 저장소 추가
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# 패키지 업데이트 및 Docker 설치
sudo apt-get update
sudo apt-get install -y docker-ce
# Docker 서비스 시작
sudo systemctl start docker
sudo systemctl enable docker
# 현재 사용자를 Docker 그룹에 추가
sudo usermod -aG docker $USER
sudo usermod -aG docker ubuntu
sudo usermod -aG docker jenkins
# Docker Compose 설치
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# 설치 확인
docker --version
docker-compose --version
echo "Docker 및 Docker Compose 설치 완료.”