New to Docker, not sure how to properly utilize CMake in build

Hey there,

I’m looking to get started with using Docker to containerize an application that I regularly use.

Before I had learned of Docker (which was pretty recent), would build my app’s dependencies with CMake and then my application would interact with everything that my Makefile built in order to get the environment and application up and running.

The idea is that I do a multi-stage image where the first stage utilizes the Makefile to build what’s needed, and the second stage uses the application’s source code/repository to use the created dependencies.

Would something like that be in the scope of what Docker is supposed to be used for? I admittedly don’t understand it to the fullest, so I was wondering if this way of working is even good or if I should just keep doing it the old way.

Apologies in advance if this isn’t something that should be done with containers.

Why not use a search engine (“docker multi stage build example cmake”) and use one of the many tutorials, for example this one?