I created a jar file using Spring Boot and created an image from it.
Using the following command, I will execute the relevant image and the program will be executed:
docker run -p 8080:8080 81b7afe627db
81b7afe627db is the name of my image.
I can not exit the program using ctrl+c while it is running.
Using this key combination does not seem to have any effect on the running container.
Is there a way for me to stop my program?
>Solution :
Consider two modes: 1- Container attachment 2- Container execution.
You can use -t in your command. In this case, you can use ctrl+c to leave your container without leaving it:
docker run -t -p 8080: 8080 81b7afe627db
Also, if you use -t and -i in your command, then you can terminate the execution of your container:
docker run -it -p 8080: 8080 81b7afe627db
Note: If you use -it and use the ctrl+p crtl+q key combination, then your container will be detach without termination.
You can use the docker ps command in a separate window to view the status of your containers.