AWS) Lightsail에 Docker 설치 후 fastapi 연동

나 안해·2023년 3월 10일
0

AWS

목록 보기
10/12
post-thumbnail

안되면 앞에 sudo

1. Docker

  • apt install apt-transport-https ca-certificates curl software-properties-common

  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  • add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

  • apt update

  • apt-cache policy docker-ce

  • apt install docker-ce


2. Docker에 sudo 권한 부여

usermod -aG docker $USER
newgrp docker


3. 설치 확인

systemctl status docker


4. Docker-compose

curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

5. Docker-compose에 실행권한 부여

chmod +x /usr/local/bin/docker-compose


6. 설치확인

systemctl status docker

curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose
docker-compose version


?

?.1 모듈을 못찾으면

docker rm -f $(docker ps -qa)
docker image rm -f $(docker image ls -q)
docker system purune -a -f --volumes

?.2 포트 중복시

lsof -i :8000 : 포트 사용중인지 확인
kill -9 pid id : 포트 죽이기

0개의 댓글