Grokkering Dockering
Docker is pretty important these days, and it’s widely used across various organizations, but I currently don’t have any opportunities to deploy it at my working environment. Best thing to do in that case is start yet another side project where you get to brass tacks with the technology you want to learn and make something super simple to get up to speed. Consider this part 1 of X where I get more familiar with CI/CD pipelines and all the tools it requires. Docker’s the starting point.
Here are the basics. Docker makes containers. Containers are basically like super tiny virtual machines that contain everything you need to run an app or service. They’re sandboxed and isolated from other services too (unless you link them on a Docker network). The benefit to running apps in containers is that they’re portable, small enough to take minimal resources, and they’re encapsulated so any app updates are less costly to the system.
To build a container, you need an image, and to get an image, you need an app and a Dockerfile. A Dockerfile is a list of commands that gets run to build the Docker image. (For example, maybe a Dockerfile runs a command to install dependencies, then runs test suites, exposes a network port, etc.) From there, you can run the container from the command line like other types of apps. You can also use Docker Compose to set up a compose.yaml file to handle the command work for you.
You can even attach a database to your container, but it takes a bit of doing. Either you make a volume that gets mounted when the container gets started, or you set up a database container and hook it to the main container through a network. Fortunately, you can add these commands to your Dockerfile as well as a service (which is great for me, because otherwise this involves levels of Linux-tier command line stuff that this boy who grew up on Windows 95 never feels 100% confident in).
The trick after that is to hook it to a CI/CD pipeline, like Jenkins or Kubernetes. (Still don’t know how they come up with the names for some of these services. I still remember asking Jeeves for things, Jenkins can’t replace him.) This is an overall fundamental understanding I want to get. Like I said before, I don’t have any opportunities in my current job to really use these services, especially the entire CI/CD pipeline, so I’m going to have to get familiar with it on my own.
For the moment, walking through Docker’s getting started guide has given me a good overhead view of the process. I always appreciate a good basics guide for these services - it’s better to start small and lean with understanding before stacking on additional layers. (Same goes for building an actual project, too.)