Get an introduction to Docker and explore the basic workflow of a Docker engine, CLI, and registry.
- Creating a Docker image and running a container is an important part of the Kubernetes Workflow for Java Developers. In this section, we'll learn how a Java application can be packaged as a Docker image and run as a container. Let's start with learning how the basic Docker Workflow works. There are three components in wall in the Docker Workflow. A client host, a server host, and a registry. Let's start with registry. Registry is a stateless highly scalable server side application that stores and lets you distribute Docker images.
This is typically hosted on the internet, such as Docker Hub or Amazon Elastic Container Registry. It could be hosted inside the firewall as well. Such as using JFrog's Artifactory or other similar products. This is where all your Docker images, including application images are published. Docker client host is from where the commands to download an image or run a container are issued. This could be your Dell machine during development or CI/CD pipeline that is giving the commands to run the containers.
The command is typically issued using Docker CLI which is also installed on the client host. Finally, there is server host where the images are downloaded for your use and containers are run. There are multiple server hosts to make the application highly available. Each server host has Docker Engine installed that is listening for commands. Let's look at how the flow looks like. App Developer creates a Docker image and publishes it on the registry, my app in our case.
The developers gives the command from the client host like, Docker container run, using Docker CLI. CLI than translates this command to arrest request and sends it to the Docker Engine on the server host. Docker Engine checks if the image is already available on the server host. If the image already exists, then it runs the container. If the image does not exist, then it downloads the image from the pre-configured registry and runs the container.
The image is stored on the server for later reuse. If multiple instances of the container for the same image needs to run, then the image is only downloaded once, unless a newer version is specified. I also have a course on Docker for Java Developers that provides much more details about how you can get started with Docker. But the knowledge provided in this course is enough for you to get going.
- Packaging applications using Docker
- Building a Docker image with a Dockerfile and Jib
- Defining Kubernetes clusters
- Deploying with standalone manifests
- Deploying with Helm charts
- Deploying a Kubernetes cluster on AWS
- Adding an Istio service mesh
- Shifting traffic with Istio
- Creating a deployment pipeline