GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sbcd90/docker-java-sample-webapp: A simple java webapp + docker + docker-compose + kubernetes exploration project

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
src/main
src/main
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

docker-java-sample-webapp

Getting started

  • Build the java app

mvn clean install

  • Take the war file from target & put it into src/main/docker directory.

Docker commands approach

  • Go into src/main/docker directory

  • Build the docker image

docker build -t tomcat:1 .

  • Run the image inside a container

docker container run -p 8080:8080 tomcat:1

  • Go to http://localhost:8080/docker-java-sample-webapp-1.0-SNAPSHOT?name=World & see the app running in docker

  • List all containers

docker container ls

  • Stop container

docker container kill <container-id>

  • Remove container

docker rm <container-id>

  • List all images

docker images

  • Remove image

docker rmi tomcat:1

  • Remove base image

docker rmi bitnami/tomcat:latest

Docker compose approach

  • Go into src/main/docker directory

  • Execute the command

docker-compose up

  • When it is stopped, the corresponding containers are deleted also. But images remain. They have to be deleted using commands.

Kubernetes approach

  • Use docker edge channel. It has inbuilt kubernetes support.

  • To get kubernetes dashboard running

  • kubectl cluster-info

  • kubectl -n kube-system edit service kubernetes-dashboard

  • You should see yaml representation of the service. Change type: ClusterIP to type: NodePort and save file. If it's already changed go to next step.

  • kubectl -n kube-system get service kubernetes-dashboard

  • Now deploy the war

  • Use helm 2.8.2

  • helm.exe install .

  • To delete entire deployment

  • kubectl delete deployment kissing-fish-java-sample-webapp

Extras

  • Log into the container

docker exec -it [container-id] bash

About

A simple java webapp + docker + docker-compose + kubernetes exploration project

Resources

Readme
Activity

Stars

10 stars

Watchers

1 watching

Forks

39 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.