Skip to content

Commit ae9331d

Browse files
committed
Document unix socket base_url usage
1 parent cddf3c6 commit ae9331d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ create_response = docker.containers.create(name: "sample-container")
3737
puts(create_response.Id)
3838
```
3939

40+
### Using a Unix socket
41+
42+
You can connect to a local Docker daemon over a Unix socket by setting `base_url` to a `unix:///...` path:
43+
44+
```ruby
45+
docker = DockerEngineRuby::Client.new(
46+
base_url: "unix:///var/run/docker.sock"
47+
)
48+
```
49+
50+
When `base_url` uses `unix:///`, TLS-related options are not used. TLS/mTLS configuration applies to HTTPS daemon endpoints (for example, `https://localhost:2376`).
51+
4052
### Handling errors
4153

4254
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `DockerEngineRuby::Errors::APIError` will be thrown:

0 commit comments

Comments
 (0)