2.1.1 Create Docker Container Image of your Application
This tutorial demostrates how to create a Docker Container Image of your Spring Boot Application.
Pre-Requisites
Installations
- Docker Deskop & CLI (Mac/Windows)
- Visual Studio Code
- Java (Mac/Windows)
Note: Right Click Installtions links and Click Open In New Tab
Note: Be sure to add JAVA_HOME to System Environment Varibales. See Support: All Prerequisites, Installation Notes
Note: Run the following commands in Terminal/Command line to verify Installations
docker -v
java -version
Create Docker Image
- Open your IDE
- Open the folder container your Spring Boot Application
- Open the Terminal in your IDE
- Open Docker Desktop
- Run the following commands
-
Create a new executeable file (.jar) of your app
Mac Windows ./mvnw clean install
mvnw.cmd clean install
-
Build a Docker Image called ‘resume-image’ from your project
docker build -t resume-image .
Note: You must include the
.
at the end -
See that your image was created
docker image ls
-
- Keep track of your image name!