도커를 진행하기 전 메모리 공간 확인하기
df -h
sudo apt update
sudo apt install apt-transport-https
sudo apt install ca-certificates
sudo apt install curl
sudo apt install software-properties-common
curl을 이용해서 도커 설치
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"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker

도커 설치 확인하고 hello-world 이미지 가져오기

hello-world 컨테이너 띄우기
sudo docker run hello-world



sudo docker build -t example .
컨테이너 구동될 때 80포트가 열린다.
아마존 EC2 서버와 연결시켜줘야한다.
왼쪽의 우리의 서버 포트(host), 오른쪽은 컨테이너 포트
sudo docker run -p 80:80 example
컨테이너 띄운 다음 인바운드 규칙 편집

해당 url:80으로 들어가면 apache2가 보인다.