TL;DR: Your docker-py is so old the daemon refuses its API version. Upgrade with pip install -U docker, or pass version= explicitly to the client to negotiate a supported one.

```text
docker.errors.APIError: 400 Client Error for http+docker://[docker-host]/v1.24/containers/json: Bad Request ("client version 1.24 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version")
```

## Fix it

1. Check versions: pip show docker and docker version (server API version). Expected: client library far older than the daemon.
2. Upgrade: pip install -U docker. Expected: the 400 goes away.
3. If you cannot upgrade, pin the negotiated version: docker.APIClient(version='1.41') (use a version your daemon supports; docker version shows it). Expected: calls succeed.
4. Update requirements so the old pin does not come back.

## When this applies
- APIError 400 mentioning client version too old.

## When it doesn't
- The error is DockerException on connect: daemon unreachable, different fix.
- The error is 404 on an endpoint: the resource, not the version.

## Compatibility
- docker-py >= 4 negotiates better; daemons set the minimum.

## Why it happens
The daemon enforces a minimum API version and drops ancient ones. Old docker-py pins hardcode v1.24-era versions, which modern daemons reject.

## Edge cases
- version='auto' exists but can mask real incompatibilities; prefer upgrading the library.
