Docker, Docker-compose 올리기
AWS, 아마존반응형
Centos, Redhat 계열
# EC2 Disk 는 최소 32G 이상 확보
sudo yum -y upgrade
sudo yum install -y python3 pip3
# AWS : sudo yum install -y python3 pip
sudo yum -y install docker
sudo service docker start
sudo usermod -aG docker ec2-user
# Server Rebooting ( Or sudo su - ec2-user )
# sudo curl -L https://github.com/docker/compose/releases/download/1.28.0-rc2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo pip3 install docker
sudo pip3 install docker-compose
# sudo 로 docker-compose 실행시 Not found. sudo vi /etc/sudoers 내 secure_path 에 /usr/local/bin/ 추가후 실행
# sudo 없이 설치할 경우 참조
# sudo usermod -aG docker $USER # 현재 접속중인 사용자에게 권한주기
# sudo usermod -aG docker your-user # your-user 사용자에게 권한주기
# AWS 보안 그룹에 80 등 필요한 포트 추가할 것
Centos6 에서 오류시 참조 : https://storycode.tistory.com/484
Ubuntu 계열
# 참조 : https://blog.dalso.org/linux/ubuntu-20-04-lts/13118
# EC2 Disk 는 최소 32G 이상 확보
> cat /etc/issue # Ubuntu 20.04.2 LTS \n \l
> sudo apt update
> sudo apt upgrade
> sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add
> arch # x86_64 확인
> sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
> sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io
> sudo usermod -aG docker "ubuntu계정"
# Server Rebooting ( Or sudo su - "ubuntu계정" )
> docker -v # Docker version 20.10.7. build f0df350
> sudo systemctl enable docker && sudo service docker start
> service docker status # Acitive: active (running) 확인
#> 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 curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
> sudo chmod +x /usr/local/bin/docker-compose
> sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
> docker-compose -v
> sudo apt install python3-pip
# 스크립트로 설치
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# 그룹추가
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
# daemon에 권한 설정
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo vim /etc/systemd/system/docker.service.d/override.conf
[Service]
ExecStartPost=/bin/chmod 666 /var/run/docker.sock
sudo systemctl daemon-reload
sudo systemctl restart docker
반응형
'AWS, 아마존' 카테고리의 다른 글
EFS.EC2.연결 (0) | 2021.09.08 |
---|---|
EBS 용량 늘리기 (0) | 2021.04.29 |
EFS 를 onpremise.NFS 에 연결하기 (0) | 2021.02.01 |
ECR 에 AWS.EC2.Docker 이미지를 ECR 에 올리기 (0) | 2020.10.08 |
ERROR.Permissions 0455 for 'apache-bench.pem' are too open. (0) | 2020.05.28 |