I 've built an image using A Dockerfile and I've noticed an error in the created image. I've then run the image and fixed the error.
Now I would like to know if the correct flow is to commit the changes to the built image, or create a new image.
Thanks
If a working image is all you want, then committing it is fine. You will then get a new image that includes your fix.
However, the benefit of having a Dockerfile is that your build is reproducible, so if your ever want to share the image with someone else, or foresee yourself rebuilding it, you should probably maintain the Dockerfile.
Basically you have two options:
Dockerfile and rebuild it, that's the reason we have Dockerfile, from which an expected/correct image can be built by anybody at anywhereDockerfile, which is the "definetion" of your image and I believe you don't want to leave any kind of "bug" in it.