In This post we are going to Deploy and Run Spring Boot Application as Docker Container within Amazon EC2 Instance.
In my previous Post I have already shown how to create Docker Image and Publish to Docker hub registry using Jib Maven Plugin and using Jib Gradle Plugin for a Spring Boot Application.
So here we will follow the same Steps to create a Simple Spring Boot Application and Push as Docker Image using Gradle Jib Plugin. So our newly created image should be build and pushed to our Docker Hub repository
In one my Post we have seen how to create an Amazon EC2 instance in AWS Management Console and get connect to the EC2 instance using putty. So we will follow the same steps and create an Amazon EC2 instance.
Now to Run Spring Boot Application as Docker Container within Amazon EC2 Instance we need docker demon running in side our EC2 instance, So need to download and install docker inside our EC2 instance. Run the below command
sudo yum install docker
Docker will install successfully inside our EC2 instance as show in the below snapshot:
Next we need to pull the image of our Spring Boot Application from our docker hub repository and for this just go to Docker Hub Dashboard and copy the Docker Pull command
docker pull rajivksingh13/my-gradle-teachlea:1.1.2
0 Comments