Skip to content

AmirKeshavarz/hello-docker-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Java + Docker

This repository contains source code example for build a multi-stage docker.

This project contains a very simple Spring-boot code which responses on http://localhost:8080

And also contains a Dockerfile which is a multi-stage docker file.

How to run

  • Docker must be installed on your system

  • In terminal go to root of the project and run :

    • # docker build -t hello .
    • # docker run hello -p 8080:8080
  • Go to browser and browse into http:\localhost:8080

Next

Below, a couple of points mentioned which are not described here to keep this sample simple.

  • Use -v option of docker for mounting your local maven repository and prevent downloading maven dependencies in build repetitive phase.
  • Use Maven plugins for building images instead of direct docker CLI commands.
  • Push docker image into a docker hub to make it accessible from hosts outer of your local.

Thanks for reading
Amir Keshavarz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published