Docker Community Forums

Share and learn in the Docker community.

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?

Step 1: Check current image version. …
Step 2: Stop the container. …
Step 3: Remove the container. …
Step 4: Pull your desired image version. …
Step 5: Launch the updated container. …
Step 5: Verify the update.

But your assuming I’m updating an image like e.g. myself. But I’m not.
I have nothing to “pull”. As per your instructions. I just have a dockerfile based on Ubuntu. So what do you mean at step 4: pull your desired image version.

All I want to know is how to build and run a new image after simply updating the main.cpp. It works first time, till the main.cpp is updated and when I build with a new tag, there is no change in output. How do I solve this please.