Agentic AI with Java: Live Cohort
DockerDockerizing Applications

Push Spring Boot Image To Docker Hub

Tag a Spring Boot Docker image and push it to Docker Hub.

After dockerizing a Spring Boot application, the next step is sharing the image.

Docker Hub lets you upload the image so another machine can pull and run the same Spring Boot app.

Build the Spring Boot image

docker build -t spring-web-app:1.0 .

Check:

docker images

Log in

docker login

Tag for Docker Hub

Use your Docker Hub username:

docker tag spring-web-app:1.0 username/spring-web-app:1.0

You can also tag a latest version:

docker tag spring-web-app:1.0 username/spring-web-app:latest

Push the image

docker push username/spring-web-app:1.0

If you tagged latest, push that too:

docker push username/spring-web-app:latest

Run from Docker Hub

On another machine:

docker pull username/spring-web-app:1.0
docker run -d -p 8080:8080 username/spring-web-app:1.0

Tagging habit

Use clear versions for real projects.

spring-web-app:1.0
spring-web-app:1.1
spring-web-app:prod-2026-09-13

Pushing an image means the application package is now portable. The server does not need your source code; it only needs Docker and access to the image.

Written By: Shiva Srivastava

How is this guide?

Last updated on