Web/AWS
AWS Docker 설정
태윤2
2022. 6. 26. 09:53
- 접속
chmod 400 #{path}.pem
ssh -i pem경로 ec2-user(기본값)@퍼블릭 Ipv4 주소
ssh -i ~/Desktop/vimeal_kafka_key.pem ec2-user@#{ip}
- docker 설치
sudo yum install docker -y
sudo service docker start
- 사용자 추가
sudo usermod -aG docker ec2-user
- auto-start에 docker 등록
sudo chkconfig docker on
- 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
- docker compose 권한 부여
sudo chmod +x /usr/local/bin/docker-compose
- docker group 에 유저 추가
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
docker network 생성
docker network create --gateway 172.18.0.1 --subnet 172.18.0.0/16 #{network_name}
bridge가 아닌 network Ip 주소할당을위해 직접 게이트웨이, 서브넷 할당