3 Publishing your first microservice
This chapter covers
- Learning the difference between images and containers
- Using Docker in your development environment
- Packaging your microservice as a Docker image
- Creating a private container registry
- Publishing your microservice to your container registry
- Instantiating your microservice in a container
By the end of this book, we’ll have deployed multiple microservices to our production environment: a Kubernetes cluster. But before we can deploy an entire microservices application, we must first be able to package and publish a single microservice! In this chapter, we’ll take the video-streaming microservice we created in chapter 2 and publish it so that it’s ready for deployment to our cluster.
In order to deploy a microservice to a cluster running in the cloud, we have to publish it somewhere that’s accessible from the cluster. To achieve this, we must first package our code, assets, and dependencies into a single bundle. We’ll then need a location in the cloud to host this package. For that, we’ll create a container registry. If you haven’t heard of containers yet, this will be explained soon.
In this book, we want to emulate the building of a proprietary application for a private company. Security and privacy are important, and that’s why we’ll create a private container registry as opposed to a public one. We’ll create this container registry manually on Azure, but later in chapter 7, we’ll learn how we can build our registry with code.