EC2 만들었다는 가정하에 진행. 해당 글에서는 ubuntu 20.04 로 install 진행
1. Docker 설치하기
sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt install -y docker-ce
sudo systemctl status docker => DOCKER RUNNING 확인 가능
2. Docker-compose 설치하기
sudo curl \
-L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
3. 기타 일반 user에 docker 권한 부여하기 (필요시)
sudo usermod -aG docker ${USER}
sudo service docker restart
logout
ec2 재접속
4. docker_install.sh (위 작업 합친 내용)
# docker install
sudo apt-get -y update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt install -y docker-ce
# docker-compose install
sudo curl \
-L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo usermod -aG docker ${USER}
sudo service docker restart
'AWS > AWS 일반' 카테고리의 다른 글
[AWS] EC2에 S3 Mount 하기 - ubuntu 20.04 (with. s3fs) (0) | 2022.08.08 |
---|---|
[AWS] EC2에서 mysql 설치 하기 (0) | 2022.08.08 |
[AWS] 자주 쓰는 명령어 정리 (SSH, SCP, python 버전 변경, 비번 setting) (0) | 2022.08.07 |
[AWS] AWS Service 종류 정리 (0) | 2022.07.14 |
[AWS 에러] ImportError: cannot import name 'docevents' 에러 (0) | 2022.07.06 |