Docker image update

Hello, I have a c++ docker image of some basic server api verbs im working with. My issue is…
Why doesn’t it run correctly when I update the main.cpp code. There’s something I’m not seeing. Is it cmake, cmake list??
For example, I may change hello world to “hello world 2” with a new image tag but no change in output. Yet building the original works. No wonder, no matter how much I change the main.cpp code, the old image is still built.

Un yet the expected updating process works fine for an ordinary cup program based on gcc.

So why isnt the update working?