
Discover how Docker packages applications into portable, versioned containers that run on a single host, offering isolation and easy deployment with images, Dockerfile, and registries.
Learn to write a dockerfile, build a java image from openjdk, and run it as a container with an end-to-end demo, covering image versus container and key docker commands.
Learn to use Gradle to compile Java, build jar packages with dependencies, and create Docker images with the Palantir Docker plugin, aided by startup scripts and environment variables.
Choose a small, official base image to minimize build time, transfer time, and attack surface when shipping Java containers; compare OpenJDK and AdoptOpenJDK, and target Java 11 with slim variants.
Master multi-stage docker builds to produce lean production images by building inside docker, copying artifacts between stages, and extracting tar files to keep the final image small.
Explore GraalVM native image, an ahead-of-time compiler that creates small, fast Java binaries for Docker in a containerized environment, with caveats around dynamic reflection and startup benefits.
Build GraalVM native images inside Docker with a two-stage workflow to produce small production binaries. Use a base image, copy the jar, and enable static linking for a seven-megabyte image.
If you need to learn how to run, tune, and maintain JVM applications that run in Docker and/or Kubernetes then this is the course for you.
This course is very different from other Java/Docker/Kubernetes courses. It focuses on all the skills that you need to succeed in production.
All of the examples are in Java but the content is applicable for any JVM language including Scala, Groovy, and Kotlin.
We'll start with introductions for Docker and Kubernetes then we'll get into the fun stuff. We'll learn:
What a container is under the covers
Linux cgroups
Linux namespaces
Then we will go into how the JVM and your Java application behave differently in Kubernetes when running inside cgroups and namespaces. We'll cover:
JVM ergonomics
How CPU Shares and Quota work
How Kubernetes manages CPU and Memory
Then we will teach you all the techniques needed to build production-ready images:
Selecting a base image
JDK vs JRE based images
Multi-stage Docker builds
GraalVM
Class data sharing
Ahead of time compilation
We will experiment with different JVM versions and settings.
By the end of this course you'll know how to:
Build a production-ready image
Select between using CPU limits, quotas, or both in Kubernetes
Select memory limits and tune the JVM for running in Kubernetes
Understand CPU usage in Kubernetes and know why it is different to VMs and physical machines.