hmmm, lets see... So I'll try to do a little knowledge dump. My main base I would say was a beginner docker course on acloudguru or the other one (im drawing a blank). Then I'd say here : Orientation and setupI used docker for the first time last month. Do you know of any good vids to help me improve my skills with it?
There's like a couple different topics when talking about docker:
- Docker Desktop (windows and mac only)
- Docker CLI
- Windows vs Linux containers
- Dockerhub - docker image manager (or maybe container, i always mix up the image and container terms)
- Dockerfile - Instructs docker how to build a container
- Docker Compose - Allows you to run multiple containers together as a group (useful for local dev environments)
- Networking and Ports - important to know for intra container communication as well as external communication
- Clusters (Swarm, Kubernetes, etc) - how to manage multi-node deployments for your containers
- Helm charts - kind of like docker compose, but at a cluster level
Kubernetes is probably one of the more major topics in here because it deals with multi-node depoyments of containers and I think Google originally created it. I've only ever dealt with linux containers, and I think that actually might be the norm. So you'll want to be familiar with lunix command line. I'll also throw in a bonus topic of "Snyk" which actually can scan your container and inform you of security vulnerabilities
Some of the best practices I've come across, and please google any of these topics, but a good course or tutorial should get you started:
- Use .env files to let your docker container create env variables
- Make sure to create a variable for a container's listen port and publish port. The listen port tells the container to listen on this port, the other port will map that port so externally you can reference it.
- Example: Postgres databases usually use port 5432, but if you have multiple instances of pg locally, you may want to change the publish/target port so that you can have both running at the same time
- For db images, make sure you map the volume where data is kept to your local system, so that when you stop and start the container, the data persists
- Please take advantage of this being a image as code, and use GIT or subversion
- Also keep in mind that if you want to run CICD pipelines, they use containers as well, so this can allow you to create a container that your pipeline is able to run and hand everything it needs to run tests, compile code, deploy code, or anything else you might want to automate based on a code push
Last edited: