Example :
docker build . -t yourusername/yourapp
Showing the Docker image after building and tagging
docker images
Here you can see a docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
yourusername/example-node-app latest be083a8e3159 7 minutes ago 83.2MB
docker run -p8080:8080 yourusername/yourapp
docker run -d -p8080:8080 yourusername/yourapp
Tag your image with the Amazon ECR registry, repository, and optional image tag name combination to use
docker tag e9ae3c220b23 aws_account_id.dkr.ecr.us-west-2.amazonaws.com/my-repository:tag
docker push aws_account_id.dkr.ecr.us-west-2.amazonaws.com/my-repository:tag