When we create a our own image using Dockerfile, do we still have to create an instance of image(container) to run an application?
For example: I tried to make an image of a spring boot application using Dockerfile and then build an image out of it using “docker image build” command and checked if the application is working or not. It was working.
Now, I have published that image to Docker Hub and delete all the containers & images related to it. Obviously, the application has stopped working.
My question is what if I pull that same image later to the docker host. Do I still need to create a container out of it in order for an application to run? If yes, then why as I have already used CMD instruction in Dockerfile while building an image?