xxxxxxxxxx
$ sudo systemctl restart docker.socket docker.service
$ docker rm {container_id}
xxxxxxxxxx
# first step is checking the docker logs like this
docker logs --tail 50 --follow --timestamps <machine_name>
xxxxxxxxxx
import subprocess
def restart_docker_service():
subprocess.call(["systemctl", "restart", "docker"])
# Call the function to restart the Docker service
restart_docker_service()