Build image node

Build image node

  1. Go to EC2

    • Select Instances
    • Select EC2 you want to access
    • Select Connect

Image Node

  1. In the connection interface

    • Select EC2 Instance Connect
    • Select Connect

Image Node

  1. Install Docker Engine package
sudo amazon-linux-extras install docker

Image Node

  1. Start the Docker service.
sudo service docker start
sudo systemctl enable docker

Add ec2-user to docker group

sudo usermod -a -G docker ec2-user

Then use the following command to check

docker info

Image Node

  1. Perform a pull image
docker pull node:16-alpine

Image Node

  1. Log in to ECR
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin 999999999999.dkr.ecr.ap-southeast-1.amazonaws.com

Image Node

  1. Make a tag for the image
docker tag node:16-alpine aws-fcj-management:latest 372936203512.dkr.ecr.ap-southeast-1.amazonaws.com/aws-fcj-management:node16-alpine

Then push to ECR

docker push aws-fcj-management:latest 372936203512.dkr.ecr.ap-southeast-1.amazonaws.com/aws-fcj-management:node16-alpine

Image Node

  1. Test on ECR . interface

Image Node

  1. To prepare for the next step, we will install git
sudo yum install git

Image Node

  1. Check successfully installed git with command
git version

Image Node