Previous Lecture Complete and continue  

  Docker Workflow

Okay. So we established some common terminology so we can speak the same language. Now, let's see how we can work with Docker and Containers. First of all, we need the code, our application code, and then we would need to create the Dockerfile, which would be the blueprint for our image.

Now, step number two, we actually build our image. It's good to tag it. And on this step, we can also upload it to registry, when and if we want to run this image in the cloud. Sometimes, you just want to run it locally, which is fine too.

So actually step number three, running the container from an image. And at this point, we would specify different environmental variables that you can attach volumes, and also you can use Docker networks to orchestrate multiple containers and make them talk with each other.

Step number four, we rebuild and rerun the containers if needed, rebuild images and rerun containers. So each time you make a code change, most likely, you would have to rebuild your image unless you're using volumes. That's why it's important to tag your images.

Step number five, stop container, delete unused containers, and remove unused images. This is a typical Docker flow.