sevilayerkan / docker-helper

Makes using Docker easier
MIT License
3 stars 1 forks source link

feat(core) : isRunning function needs to be added #19

Open sevilayerkan opened 1 year ago

sevilayerkan commented 1 year ago

Is your feature request related to a problem? Please describe. isRunning function needs to be added for checking docker daemon is running or not.

Describe the solution you'd like for resolve this issue we can add a function like this:

def isRunning():
   if docker is running:
       return 1
  else:
      return 0

Additional context This function will be used in show() and in the beginning of the program.

sevilayerkan commented 1 year ago

If we want to solve this while supporting cross-platform usage, we can approach to this issue in 3 ways:

1- By checking docker ps response 2- Ping docker vm ip and check its response time (this might be spesific to certain os') 3- Using commands within docker cli 4- Or using docker lib in python

Right now as solve this issue quickly we are solving with using docker ps and std.process. If not I'll try 4th approach.

https://stackoverflow.com/questions/57108228/how-to-check-if-docker-is-running-on-windows about possible solutions.

sevilayerkan commented 1 year ago

For 4th solution : https://docs.docker.com/engine/api/sdk/examples/#list-and-manage-containers