@@ -37,8 +37,14 @@ export function createDockerApi() {
37
37
const client = createClient < paths > ( {
38
38
baseUrl : "http://localhost:10000" ,
39
39
fetch ( input ) {
40
- // @ts -ignore: dispatcher may not be typed but we know it's there
41
- input . dispatcher = agent ;
40
+ if ( typeof Bun !== "undefined" ) {
41
+ // @ts -ignore: Bun specific
42
+ input . unix = "/var/run/docker.sock" ;
43
+ } else {
44
+ // @ts -ignore: dispatcher may not be typed but we know it's there
45
+ input . dispatcher = agent ;
46
+ }
47
+
42
48
return fetch ( input . url , input ) ;
43
49
} ,
44
50
} ) ;
@@ -124,13 +130,7 @@ export function createDockerApi() {
124
130
} ) ,
125
131
create : ( params : NetworkCreateParams ) =>
126
132
POST ( "/networks/create" , {
127
- body : {
128
- name : params . name ,
129
- driver : params . driver ,
130
- labels : params . labels ,
131
- enableIPv4 : params . enableIPv4 ,
132
- enableIPv6 : params . enableIPv6 ,
133
- } ,
133
+ body : params ,
134
134
} ) ,
135
135
// TODO(manuel): Implement filters query param
136
136
prune : ( ) => POST ( "/networks/prune" ) ,
@@ -250,7 +250,6 @@ interface ListImagesParams
250
250
* process on the images list.
251
251
*
252
252
* Available filters:
253
- *
254
253
* - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`)
255
254
* - `dangling=true`
256
255
* - `label=key` or `label="key=value"` of an image label
0 commit comments