0% found this document useful (0 votes)
3 views4 pages

Dockerizing Spring Boot in AWS Notes

This document outlines the steps for containerizing a Spring Boot application using Docker and deploying it on AWS EC2. It includes commands for building the Docker image, running the container, connecting to the EC2 instance, installing Docker, and pushing the image to Docker Hub. Additionally, it provides instructions for managing Docker containers and configuring EC2 instance inbound rules.

Uploaded by

arun.mbabu246
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Dockerizing Spring Boot in AWS Notes

This document outlines the steps for containerizing a Spring Boot application using Docker and deploying it on AWS EC2. It includes commands for building the Docker image, running the container, connecting to the EC2 instance, installing Docker, and pushing the image to Docker Hub. Additionally, it provides instructions for managing Docker containers and configuring EC2 instance inbound rules.

Uploaded by

arun.mbabu246
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

JavaCafee Tech Connect Ep.

1
Spring-Boot Docker AWS

1 ./mvnw clean package NOTES


2 java -jar ./target/<your- le>-<version>SNAPSHOT.jar

Containerising App in Local Docker Env

3
docker build -t employee-app . --platform linux/x86_64

4docker run -it -p 8080:8080 --name employee-app-container


This is an optional param, we use this only when
we Dockerize app from Mac OS M1 or M2 Chip

f7435dfa5193

[email protected]
fi
Connecting EC2 Instance & Installing Docker
create new ec-instance default
connect to ec2-instance via SSH tool
sudo su - [to switch to root user]
yum install docker
cat /etc/group [how many software groups are there for
root user]
usermod -aG docker ec2-user [giving group permission to user
for accessing docker]
sudo su ec2-user
sudo systemctl status docker [check if docker engine is started]
sudo systemctl start docker [or] sudo service docker start [start the
docker engine]
sudo systemctl status docker [now again check the status of the
docker engine]
sudo systemctl stop docker [to stop the docker]

[email protected]
Pushing The Image To Docker HUB & Pull

docker login --username javacafee

docker tag employee-app:latest javacafee/


etailrepo:employee-app

docker push javacafee/etailrepo:employee-app

docker pull javacafee/etailrepo:employee-app

docker run -d -p 8080:8080 --name employee-app-


container f7435dfa5193

Run this command to end all Docker containers: sudo docker kill $
(docker ps -q)

Remove the Docker lock les: sudo rm -f /var/run/docker /var/run/


docker.*

[email protected]
fi
EC2 Instance Inbound Rule Settings

[email protected]

You might also like