Skip to content

up1/workshop-java-springboot-docker-k8s

Repository files navigation

Demo project

  • Java with Spring Boot
  • Apache Maven project
  • Working with Docker
    • Dockerfile
    • Docker compose
  • Working with Kubernetes
    • Pod
    • Service
    • Deployment

1. Working with Apache Maven

$mvnw clean package
$java -jar target/hello-0.0.1-SNAPSHOT.jar

Call APIs

2. Working with Docker

Build image

$docker image build --progress=plain -t somkiat/hello-spring:1.0 .
$docker image ls

Create container

$docker container run -d -p 8080:8080 somkiat/hello-spring:1.0

Call APIs

3. Working with Docker compose

Building image

$docker-compose -f docker-compose-build.yml build --progress=plain
$docker image ls

Create container

$docker-compose -f docker-compose-deploy.yml up -d
$docker-compose -f docker-compose-deploy.yml ps

NAME                                 COMMAND                  SERVICE             STATUS              PORTS
hello-java-docker-kunernetes-api-1   "java -cp app:app/li…"   api                 running             0.0.0.0:8080->8080/tcp

Call APIs

Push docker image to Docker Hub

$docker login
$docker image push somkiat/hello-spring:1.0

4. Working with Kubernetes

$kubectl apply -f k8s
$kubectl get all

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published