Advertisement
PandaAcademy

Komendy EC2 - ECR

Oct 8th, 2023 (edited)
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. # ec2
  2. export AWS_ACCOUNT_ID=<numer-konta-aws>
  3. sudo yum install docker
  4. sudo service docker status
  5. sudo service docker start
  6. sudo usermod -a -G docker ec2-user
  7. sudo chmod 666 /var/run/docker.sock
  8. docker run hello-world
  9. aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com
  10. docker pull $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/backend:latest
  11. docker pull $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/frontend:latest
  12. docker image ls
  13. wget https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)
  14. chmod -v +x docker-compose-*
  15. sudo mv docker-compose-* /usr/local/bin/docker-compose
  16. docker-compose --version
  17. wget https://raw.githubusercontent.com/Panda-Academy-Core-2-0/App_of_apps/final/docker-compose.yml
  18. cat docker-compose.yml
  19. export FRONTEND_IMAGE="$AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/frontend:latest"
  20. export BACKEND_IMAGE="$AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/backend:latest"
  21. docker-compose up -d
  22. docker ps
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement