filmov
tv
How to Dockerize a Spring Boot 3 application
Показать описание
If you're doing cloud native development with Spring Boot, you'll need to Dockerize your executable JAR file at some point in time.
There are a variety of Maven, Gradle and even Jenkins plugins or add-ons that will do that. But why not just do it on your own? It's easy.
Just create a Dockerfile in the same folder as your Spring Boot executable JAR file. The contents of the JAR file look something like this:
FROM eclipse-temurin:17-jdk-alpine
Then, just build the JAR. In the same folder as the JAR files and the Dockerfile, run:
docker build -t spring-app:latest
That will build your image and then you can run it locally with a command like:
docker run -p 8099:8080 -t spring-app:latest
If you really wanted to, you could tag the image:
docker images (to find your image id)
docker tag **??a70e7b4f9e4d?? cameronmcnz/spring-app:latest
Then just do a Docker login and push the image to Docker hub!
docker long
docker push cameronmcnz/spring-app:latest
It really couldn't be easier to Dockerize a Spring Boot 3 app and push that Spring Boot docker image up to DockerHub.
There are a variety of Maven, Gradle and even Jenkins plugins or add-ons that will do that. But why not just do it on your own? It's easy.
Just create a Dockerfile in the same folder as your Spring Boot executable JAR file. The contents of the JAR file look something like this:
FROM eclipse-temurin:17-jdk-alpine
Then, just build the JAR. In the same folder as the JAR files and the Dockerfile, run:
docker build -t spring-app:latest
That will build your image and then you can run it locally with a command like:
docker run -p 8099:8080 -t spring-app:latest
If you really wanted to, you could tag the image:
docker images (to find your image id)
docker tag **??a70e7b4f9e4d?? cameronmcnz/spring-app:latest
Then just do a Docker login and push the image to Docker hub!
docker long
docker push cameronmcnz/spring-app:latest
It really couldn't be easier to Dockerize a Spring Boot 3 app and push that Spring Boot docker image up to DockerHub.
How to dockerize your Spring Boot API | Docker Tutorial
How to Dockerize a Spring Boot 3 application
Docker - Dockerizing your Spring Boot Application | Java Techie
This is how you can dockerize a Spring-Boot Application (step-by-step)
Dockerize any Spring Boot Microservice in minutes
Dockerizing a Spring Boot 3 Application | how to dockerize a spring boot application
Dockerizing Spring Boot Application | Spring Boot Docker Tutorial | Docker Image
Dockerizing Springboot Application | Docker @ashokit
Part 1- How to Dockerize Micro Services Architecture Docker and Spring cloud
How To Dockerize Spring Boot Application & PostgreSQL Database
How to Dockerize Your Spring Boot Application on Windows (Step by Step)
🔥 New in Spring Boot 3.1 - Spring Boot Docker Compose Module
How To Dockerize A SPRING Application?
Dockerfile >Docker Image > Docker Container | Beginners Hands-On | Step by Step
Docker Deployment |How to Deploy Your Spring Boot CRUD Project With MySQL Database in Docker
Spring Boot Docker and PostgreSQL
How to Dockerize Spring boot with MySql | Implementation | Live Demo | Docker Compose | Code Decode
Dockerize Spring Boot Application | Create docker image for spring boot w MySQL | Docker - Part 1
Dockerize a simple spring server
Docker tutorial for beginners | [In 2 Hours]
Two Way to Dockerize Your Spring Boot App - A Beginner Docker Tutorial
Dockerize spring boot application example from scratch | Run spring boot application in docker
Spring Boot Microservices Project Example - Part 9 | Dockerize the application
How to use Docker to dockerize a Spring Boot application, React app, NginX proxy | Docker Compose
Комментарии