From fc01f1aa311f9d9b002a5745448e40d7959dadca Mon Sep 17 00:00:00 2001 From: JustFiesta Date: Fri, 17 May 2024 13:04:18 +0200 Subject: [PATCH] Remove unessasary source command + typo fix + SSH commands for pulling and running docker image --- run_container_on_EC2.sh | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/run_container_on_EC2.sh b/run_container_on_EC2.sh index 31848a145..6c787b27c 100644 --- a/run_container_on_EC2.sh +++ b/run_container_on_EC2.sh @@ -3,12 +3,11 @@ # This script sets authenthicates and pulls docker image. Then runs it on host # Global data -source ./send_image_to_aws.sh IMAGE_NAME="$ECR_NAME:latest" FULL_KEY_PATH="" -read -p "Enter your AWS Key absoluet path: " FULL_KEY_PATH +read -p "Enter your AWS Key absolute path: " FULL_KEY_PATH # Get the public IP of EC2 instance from previus script echo "Getting public IP address of EC2 instance..." @@ -34,11 +33,31 @@ fi # SSH to EC2 and run instance echo "SSH-ing to EC2 instance and running Docker image from ECR..." ssh -i "$FULL_KEY_PATH" ec2-user@"$PUBLIC_IP" <