Skip to content

Commit b22e390

Browse files
committed
Merge branch 'TomasTomecek-improve-version-mismatcj'
2 parents b65de73 + 230d8c7 commit b22e390

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/api.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ is hosted.
1818
* tls (bool or [TLSConfig](tls.md#TLSConfig)): Equivalent CLI options: `docker --tls ...`
1919
* user_agent (str): Set a custom user agent for requests to the server.
2020

21+
2122
****
2223

2324
## attach
@@ -1203,3 +1204,26 @@ TODO:
12031204
* load_image
12041205

12051206
-->
1207+
1208+
****
1209+
1210+
## Version mismatch
1211+
1212+
You may encounter an error like this:
1213+
1214+
```text
1215+
client is newer than server (client API version: 1.24, server API version: 1.23)
1216+
```
1217+
1218+
To fix this, you have to either supply the exact version your server supports
1219+
when instantiating the `Client`:
1220+
1221+
```python
1222+
client = docker.Client(version="1.23")
1223+
```
1224+
1225+
or let the client automatically detect the newest version server supports:
1226+
1227+
```python
1228+
client = docker.Client(version="auto")
1229+
```

0 commit comments

Comments
 (0)