Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to crash a docker container deliberately?

I'm running a web app as a container and I'm storing the logs generated by this app in a file. But the log file generated by the app is created inside the container file system , So to access these logs when the container crashes I'm using docker volume, so that i have access to log files even if the container crashes.But i want to test if this really works when the container crashes , So any help on how to test would be highly appreciated. Thanks.

like image 241
nithin maskalle Avatar asked Oct 29 '22 11:10

nithin maskalle


1 Answers

You have two options

1) Stop the container:

docker stop container_name

2) Kill the container

docker kill container_name
like image 143
Akki Avatar answered Nov 15 '22 01:11

Akki