UNPKG

68.1 kBTypeScriptView Raw
1/// <reference types="node" />
2
3import * as DockerModem from "docker-modem";
4import * as events from "events";
5import * as stream from "stream";
6
7declare namespace Dockerode {
8 class Container {
9 constructor(modem: any, id: string);
10
11 modem: any;
12 id: string;
13
14 inspect(options: ContainerInspectOptions, callback: Callback<ContainerInspectInfo>): void;
15 inspect(callback: Callback<ContainerInspectInfo>): void;
16 inspect(options?: ContainerInspectOptions): Promise<ContainerInspectInfo>;
17
18 rename(options: {}, callback: Callback<any>): void;
19 rename(options: {}): Promise<any>;
20
21 update(options: {}, callback: Callback<any>): void;
22 update(options: {}): Promise<any>;
23
24 top(options: {}, callback: Callback<any>): void;
25 top(callback: Callback<any>): void;
26 top(options?: {}): Promise<any>;
27
28 changes(options: {}, callback: Callback<any>): void;
29 changes(callback: Callback<any>): void;
30 changes(options?: {}): Promise<any>;
31
32 export(options: {}, callback: Callback<NodeJS.ReadableStream>): void;
33 export(callback: Callback<NodeJS.ReadableStream>): void;
34 export(options?: {}): Promise<NodeJS.ReadableStream>;
35
36 start(options: ContainerStartOptions, callback: Callback<any>): void;
37 start(callback: Callback<any>): void;
38 start(options?: ContainerStartOptions): Promise<any>;
39
40 pause(options: {}, callback: Callback<any>): void;
41 pause(callback: Callback<any>): void;
42 pause(options?: {}): Promise<any>;
43
44 unpause(options: {}, callback: Callback<any>): void;
45 unpause(callback: Callback<any>): void;
46 unpause(options?: {}): Promise<any>;
47
48 exec(options: ExecCreateOptions, callback: Callback<Exec>): void;
49 exec(options: ExecCreateOptions): Promise<Exec>;
50
51 commit(options: {}, callback: Callback<any>): void;
52 commit(callback: Callback<any>): void;
53 commit(options?: {}): Promise<any>;
54
55 stop(options: ContainerStopOptions, callback: Callback<any>): void;
56 stop(callback: Callback<any>): void;
57 stop(options?: ContainerStopOptions): Promise<any>;
58
59 restart(options: {}, callback: Callback<any>): void;
60 restart(callback: Callback<any>): void;
61 restart(options?: {}): Promise<any>;
62
63 kill(options: {}, callback: Callback<any>): void;
64 kill(callback: Callback<any>): void;
65 kill(options?: {}): Promise<any>;
66
67 resize(options: {}, callback: Callback<any>): void;
68 resize(callback: Callback<any>): void;
69 resize(options?: {}): Promise<any>;
70
71 wait(options: ContainerWaitOptions, callback: Callback<any>): void;
72 wait(callback: Callback<any>): void;
73 wait(options?: ContainerWaitOptions): Promise<any>;
74
75 remove(options: ContainerRemoveOptions, callback: Callback<any>): void;
76 remove(callback: Callback<any>): void;
77 remove(options?: {}): Promise<any>;
78
79 /** Deprecated since RAPI v1.20 */
80 copy(options: {}, callback: Callback<any>): void;
81 /** Deprecated since RAPI v1.20 */
82 copy(callback: Callback<any>): void;
83 /** Deprecated since RAPI v1.20 */
84 copy(options?: {}): Promise<any>;
85
86 getArchive(options: {}, callback: Callback<NodeJS.ReadableStream>): void;
87 getArchive(options: {}): Promise<NodeJS.ReadableStream>;
88
89 infoArchive(options: {}, callback: Callback<any>): void;
90 infoArchive(options: {}): Promise<any>;
91
92 /** @param file Filename (will read synchronously), Buffer or stream */
93 putArchive(
94 file: string | Buffer | NodeJS.ReadableStream,
95 options: {},
96 callback: Callback<NodeJS.WritableStream>,
97 ): void;
98 putArchive(file: string | Buffer | NodeJS.ReadableStream, options: {}): Promise<NodeJS.ReadWriteStream>;
99
100 logs(options: ContainerLogsOptions & { follow?: false }, callback: Callback<Buffer>): void;
101 logs(options: ContainerLogsOptions & { follow: true }, callback: Callback<NodeJS.ReadableStream>): void;
102 logs(callback: Callback<Buffer>): void;
103 logs(options?: ContainerLogsOptions & { follow?: false }): Promise<Buffer>;
104 logs(options?: ContainerLogsOptions & { follow: true }): Promise<NodeJS.ReadableStream>;
105
106 stats(options: { stream?: false; "one-shot"?: boolean }, callback: Callback<ContainerStats>): void;
107 stats(options: { stream: true }, callback: Callback<NodeJS.ReadableStream>): void;
108 stats(callback: Callback<ContainerStats>): void;
109 stats(options?: { stream?: false; "one-shot"?: boolean }): Promise<ContainerStats>;
110 stats(options?: { stream: true }): Promise<NodeJS.ReadableStream>;
111
112 attach(options: ContainerAttachOptions, callback: Callback<NodeJS.ReadWriteStream>): void;
113 attach(options: ContainerAttachOptions): Promise<NodeJS.ReadWriteStream>;
114 }
115
116 class Image {
117 constructor(modem: any, name: string);
118
119 modem: any;
120 id: string;
121
122 inspect(callback: Callback<ImageInspectInfo>): void;
123 inspect(): Promise<ImageInspectInfo>;
124
125 history(callback: Callback<any>): void;
126 history(): Promise<any>;
127
128 get(callback: Callback<NodeJS.ReadableStream>): void;
129 get(): Promise<NodeJS.ReadableStream>;
130
131 push(options: ImagePushOptions, callback: Callback<NodeJS.ReadableStream>): void;
132 push(callback: Callback<NodeJS.ReadableStream>): void;
133 push(options?: ImagePushOptions): Promise<NodeJS.ReadableStream>;
134
135 tag(options: ImageTagOptions, callback: Callback<any>): void;
136 tag(callback: Callback<any>): void;
137 tag(options?: ImageTagOptions): Promise<any>;
138
139 remove(options: ImageRemoveOptions, callback: Callback<ImageRemoveInfo>): void;
140 remove(callback: Callback<ImageRemoveInfo>): void;
141 remove(options?: {}): Promise<any>;
142
143 distribution(options: ImageDistributionOptions, callback: Callback<ImageDistributionInfo>): void;
144 distribution(callback: Callback<ImageDistributionInfo>): void;
145 distribution(options?: ImageDistributionOptions): Promise<ImageDistributionInfo>;
146 }
147
148 class Volume {
149 constructor(modem: any, name: string);
150
151 modem: any;
152 name: string;
153
154 inspect(options: {}, callback: Callback<VolumeInspectInfo>): void;
155 inspect(callback: Callback<VolumeInspectInfo>): void;
156 inspect(options?: {}): Promise<VolumeInspectInfo>;
157
158 remove(options: VolumeRemoveOptions, callback: Callback<any>): void;
159 remove(callback: Callback<any>): void;
160 remove(options?: VolumeRemoveOptions): Promise<any>;
161 }
162
163 class Service {
164 constructor(modem: any, id: string);
165
166 modem: any;
167 id: string;
168
169 inspect(options: {}, callback: Callback<any>): void;
170 inspect(callback: Callback<any>): void;
171 inspect(options?: {}): Promise<any>;
172
173 remove(options: {}, callback: Callback<any>): void;
174 remove(callback: Callback<any>): void;
175 remove(options?: {}): Promise<any>;
176
177 update(options: {}, callback: Callback<any>): void;
178 update(options: {}): Promise<any>;
179
180 logs(options: ContainerLogsOptions, callback: Callback<NodeJS.ReadableStream>): void;
181 logs(callback: Callback<NodeJS.ReadableStream>): void;
182 logs(options?: ContainerLogsOptions): Promise<NodeJS.ReadableStream>;
183 }
184
185 class Task {
186 constructor(modem: any, id: string);
187
188 modem: any;
189 id: string;
190
191 inspect(options: {}, callback: Callback<any>): void;
192 inspect(callback: Callback<any>): void;
193 inspect(options?: {}): Promise<any>;
194 }
195
196 class Node {
197 constructor(modem: any, id: string);
198
199 modem: any;
200 id: string;
201
202 inspect(options: {}, callback: Callback<any>): void;
203 inspect(callback: Callback<any>): void;
204 inspect(options?: {}): Promise<any>;
205
206 update(options: {}, callback: Callback<any>): void;
207 update(callback: Callback<any>): void;
208 update(options?: {}): Promise<any>;
209
210 remove(options: {}, callback: Callback<any>): void;
211 remove(callback: Callback<any>): void;
212 remove(options?: {}): Promise<any>;
213 }
214
215 class Plugin {
216 constructor(modem: any, name: string, remote?: any);
217
218 modem: any;
219 name: string;
220 remote: any;
221
222 inspect(options: {}, callback: Callback<PluginInspectInfo>): void;
223 inspect(callback: Callback<PluginInspectInfo>): void;
224 inspect(options?: {}): Promise<PluginInspectInfo>;
225
226 remove(options: {}, callback: Callback<any>): void;
227 remove(callback: Callback<any>): void;
228 remove(options?: {}): Promise<any>;
229
230 privileges(options: {}, callback: Callback<any>): void;
231 privileges(callback: Callback<any>): void;
232 privileges(options?: {}): Promise<any>;
233
234 pull(options: {}, callback: Callback<any>): void;
235 pull(options: {}): Promise<any>;
236
237 enable(options: {}, callback: Callback<any>): void;
238 enable(callback: Callback<any>): void;
239 enable(options?: {}): Promise<any>;
240
241 disable(options: {}, callback: Callback<any>): void;
242 disable(callback: Callback<any>): void;
243 disable(options?: {}): Promise<any>;
244
245 push(options: {}, callback: Callback<any>): void;
246 push(callback: Callback<any>): void;
247 push(options?: {}): Promise<any>;
248
249 configure(options: {}, callback: Callback<any>): void;
250 configure(callback: Callback<any>): void;
251 configure(options?: {}): Promise<any>;
252
253 upgrade(auth: any, options: {}, callback: Callback<any>): void;
254 upgrade(auth: any, callback: Callback<any>): void;
255 upgrade(auth: any, options?: {}): Promise<any>;
256 }
257
258 class Secret {
259 constructor(modem: any, id: string);
260
261 modem: any;
262 id: string;
263
264 inspect(options: {}, callback: Callback<Secret>): void;
265 inspect(callback: Callback<Secret>): void;
266 inspect(options?: {}): Promise<Secret>;
267
268 update(options: {}, callback: Callback<any>): void;
269 update(callback: Callback<any>): void;
270 update(options?: {}): Promise<any>;
271
272 remove(options: {}, callback: Callback<any>): void;
273 remove(callback: Callback<any>): void;
274 remove(options?: {}): Promise<any>;
275 }
276
277 class Network {
278 constructor(modem: any, id: string);
279
280 modem: any;
281 id: string;
282
283 inspect(callback: Callback<any>): void;
284 inspect(): Promise<any>;
285
286 remove(options: {}, callback: Callback<any>): void;
287 remove(callback: Callback<any>): void;
288 remove(options?: {}): Promise<any>;
289
290 connect(options: NetworkConnectOptions, callback: Callback<any>): void;
291 connect(callback: Callback<any>): void;
292 connect(options?: NetworkConnectOptions): Promise<any>;
293
294 disconnect(options: {}, callback: Callback<any>): void;
295 disconnect(callback: Callback<any>): void;
296 disconnect(options?: {}): Promise<any>;
297 }
298
299 class Exec {
300 constructor(modem: any, id: string);
301
302 modem: any;
303 id: string;
304
305 inspect(options: ExecInspectOptions, callback: Callback<ExecInspectInfo>): void;
306 inspect(callback: Callback<ExecInspectInfo>): void;
307 inspect(options?: ExecInspectOptions): Promise<ExecInspectInfo>;
308
309 start(options: ExecStartOptions, callback: Callback<stream.Duplex>): void;
310 start(options: ExecStartOptions): Promise<stream.Duplex>;
311
312 resize(options: {}, callback: Callback<any>): void;
313 resize(options: {}): Promise<any>;
314 }
315
316 class Config {
317 constructor(modem: any, id: string);
318
319 modem: any;
320 id: string;
321
322 inspect(options: {}, callback: Callback<ConfigInfo>): void;
323 inspect(callback: Callback<ConfigInfo>): void;
324 inspect(options?: {}): Promise<ConfigInfo>;
325
326 update(options: {}, callback: Callback<any>): void;
327 update(callback: Callback<any>): void;
328 update(options?: {}): Promise<any>;
329
330 remove(options: {}, callback: Callback<any>): void;
331 remove(callback: Callback<any>): void;
332 remove(options?: {}): Promise<any>;
333 }
334
335 type Duration = number;
336
337 interface ImageInfo {
338 Id: string;
339 ParentId: string;
340 RepoTags: string[] | undefined;
341 RepoDigests?: string[] | undefined;
342 Created: number;
343 Size: number;
344 VirtualSize: number;
345 SharedSize: number;
346 Labels: { [label: string]: string };
347 Containers: number;
348 }
349
350 interface ContainerInfo {
351 Id: string;
352 Names: string[];
353 Image: string;
354 ImageID: string;
355 Command: string;
356 Created: number;
357 Ports: Port[];
358 Labels: { [label: string]: string };
359 State: string;
360 Status: string;
361 HostConfig: {
362 NetworkMode: string;
363 };
364 NetworkSettings: {
365 Networks: { [networkType: string]: NetworkInfo };
366 };
367 Mounts: Array<{
368 Name?: string | undefined;
369 Type: string;
370 Source: string;
371 Destination: string;
372 Driver?: string | undefined;
373 Mode: string;
374 RW: boolean;
375 Propagation: string;
376 }>;
377 }
378
379 interface Port {
380 IP: string;
381 PrivatePort: number;
382 PublicPort: number;
383 Type: string;
384 }
385
386 interface NetworkInfo {
387 IPAMConfig?: any;
388 Links?: any;
389 Aliases?: any;
390 NetworkID: string;
391 EndpointID: string;
392 Gateway: string;
393 IPAddress: string;
394 IPPrefixLen: number;
395 IPv6Gateway: string;
396 GlobalIPv6Address: string;
397 GlobalIPv6PrefixLen: number;
398 MacAddress: string;
399 }
400
401 // Information returned from inspecting a network
402 interface NetworkInspectInfo {
403 Name: string;
404 Id: string;
405 Created: string;
406 Scope: string;
407 Driver: string;
408 EnableIPv6: boolean;
409 IPAM?: IPAM | undefined;
410 Internal: boolean;
411 Attachable: boolean;
412 Ingress: boolean;
413 ConfigFrom?: { Network: string } | undefined;
414 ConfigOnly: boolean;
415 Containers?: { [id: string]: NetworkContainer } | undefined;
416 Options?: { [key: string]: string } | undefined;
417 Labels?: { [key: string]: string } | undefined;
418 }
419
420 interface NetworkCreateOptions {
421 Name: string;
422 CheckDuplicate?: boolean | undefined;
423 Driver?: string | undefined;
424 Internal?: boolean | undefined;
425 Attachable?: boolean | undefined;
426 Ingress?: boolean | undefined;
427 IPAM?: IPAM | undefined;
428 EnableIPv6?: boolean | undefined;
429 Options?: { [option: string]: string } | undefined;
430 Labels?: { [label: string]: string } | undefined;
431
432 abortSignal?: AbortSignal;
433 }
434
435 interface NetworkConnectOptions {
436 Container?: string;
437 EndpointConfig?: EndpointSettings | undefined;
438 }
439
440 interface NetworkContainer {
441 Name: string;
442 EndpointID: string;
443 MacAddress: string;
444 IPv4Address: string;
445 IPv6Address: string;
446 }
447
448 /* tslint:disable:interface-name */
449 interface IPAM {
450 Driver: string;
451 Config?: Array<{ [key: string]: string }> | undefined;
452 Options?: { [key: string]: string } | undefined;
453 }
454 /* tslint:enable:interface-name */
455
456 interface VolumeCreateOptions {
457 Name?: string | undefined;
458 Driver?: string | undefined;
459 DriverOpts?: { [key: string]: string } | undefined;
460 Labels?: { [label: string]: string } | undefined;
461 abortSignal?: AbortSignal;
462 }
463
464 interface VolumePruneOptions {
465 abortSignal?: AbortSignal;
466 /**
467 * Filters to process on the prune list, encoded as JSON (a `map[string][]string`).
468 */
469 filters?: string;
470 }
471
472 interface VolumeRemoveOptions {
473 abortSignal?: AbortSignal;
474 }
475
476 interface VolumeCreateResponse {
477 Name: string;
478 Driver: string;
479 Mountpoint: string;
480 CreatedAt?: string | undefined;
481 Status?: { [key: string]: string } | undefined;
482 Labels: { [label: string]: string };
483 Scope: string;
484 Options: { [key: string]: string };
485 // Field is sometimes present, and sometimes null
486 UsageData?:
487 | {
488 Size: number;
489 RefCount: number;
490 }
491 | null
492 | undefined;
493 }
494
495 interface VolumeInspectInfo {
496 Name: string;
497 Driver: string;
498 Mountpoint: string;
499 Status?: { [key: string]: string } | undefined;
500 Labels: { [key: string]: string };
501 Scope: "local" | "global";
502 // Field is always present, but sometimes is null
503 Options: { [key: string]: string } | null;
504 // Field is sometimes present, and sometimes null
505 UsageData?:
506 | {
507 Size: number;
508 RefCount: number;
509 }
510 | null
511 | undefined;
512 }
513
514 interface ContainerInspectInfo {
515 Id: string;
516 Created: string;
517 Path: string;
518 Args: string[];
519 State: {
520 Status: string;
521 Running: boolean;
522 Paused: boolean;
523 Restarting: boolean;
524 OOMKilled: boolean;
525 Dead: boolean;
526 Pid: number;
527 ExitCode: number;
528 Error: string;
529 StartedAt: string;
530 FinishedAt: string;
531 Health?:
532 | {
533 Status: string;
534 FailingStreak: number;
535 Log: Array<{
536 Start: string;
537 End: string;
538 ExitCode: number;
539 Output: string;
540 }>;
541 }
542 | undefined;
543 };
544 Image: string;
545 ResolvConfPath: string;
546 HostnamePath: string;
547 HostsPath: string;
548 LogPath: string;
549 Name: string;
550 RestartCount: number;
551 Driver: string;
552 Platform: string;
553 MountLabel: string;
554 ProcessLabel: string;
555 AppArmorProfile: string;
556 ExecIDs?: string[] | undefined;
557 HostConfig: HostConfig;
558 GraphDriver: {
559 Name: string;
560 Data: {
561 DeviceId: string;
562 DeviceName: string;
563 DeviceSize: string;
564 };
565 };
566 Mounts: Array<{
567 Name?: string | undefined;
568 Source: string;
569 Destination: string;
570 Mode: string;
571 RW: boolean;
572 Propagation: string;
573 }>;
574 Config: {
575 Hostname: string;
576 Domainname: string;
577 User: string;
578 AttachStdin: boolean;
579 AttachStdout: boolean;
580 AttachStderr: boolean;
581 ExposedPorts: { [portAndProtocol: string]: {} };
582 Tty: boolean;
583 OpenStdin: boolean;
584 StdinOnce: boolean;
585 Env: string[];
586 Cmd: string[];
587 Image: string;
588 Volumes: { [volume: string]: {} };
589 WorkingDir: string;
590 Entrypoint?: string | string[] | undefined;
591 OnBuild?: any;
592 Labels: { [label: string]: string };
593 };
594 NetworkSettings: {
595 Bridge: string;
596 SandboxID: string;
597 HairpinMode: boolean;
598 LinkLocalIPv6Address: string;
599 LinkLocalIPv6PrefixLen: number;
600 Ports: {
601 [portAndProtocol: string]: Array<{
602 HostIp: string;
603 HostPort: string;
604 }>;
605 };
606 SandboxKey: string;
607 SecondaryIPAddresses?: any;
608 SecondaryIPv6Addresses?: any;
609 EndpointID: string;
610 Gateway: string;
611 GlobalIPv6Address: string;
612 GlobalIPv6PrefixLen: number;
613 IPAddress: string;
614 IPPrefixLen: number;
615 IPv6Gateway: string;
616 MacAddress: string;
617 Networks: {
618 [type: string]: {
619 IPAMConfig?: any;
620 Links?: any;
621 Aliases?: any;
622 NetworkID: string;
623 EndpointID: string;
624 Gateway: string;
625 IPAddress: string;
626 IPPrefixLen: number;
627 IPv6Gateway: string;
628 GlobalIPv6Address: string;
629 GlobalIPv6PrefixLen: number;
630 MacAddress: string;
631 };
632 };
633 Node?:
634 | {
635 ID: string;
636 IP: string;
637 Addr: string;
638 Name: string;
639 Cpus: number;
640 Memory: number;
641 Labels: any;
642 }
643 | undefined;
644 };
645 }
646
647 interface NetworkListOptions {
648 /**
649 * JSON encoded value of the filters (a `map[string][]string`) to process on the networks list.
650 */
651 filters?: string;
652 abortSignal?: AbortSignal;
653 }
654
655 interface NetworkStats {
656 [name: string]: {
657 rx_bytes: number;
658 rx_dropped: number;
659 rx_errors: number;
660 rx_packets: number;
661 tx_bytes: number;
662 tx_dropped: number;
663 tx_errors: number;
664 tx_packets: number;
665 endpoint_id?: string; // not used on linux
666 instance_id?: string; // not used on linux
667 };
668 }
669
670 interface VolumeListOptions {
671 abortSignal?: AbortSignal;
672 /**
673 * A JSON encoded value of the filters (a map[string][]string) to process on the images list.
674 */
675 filters?: string;
676 /**
677 * Show digest information as a RepoDigests field on each image.
678 * @default false
679 */
680 digests?: boolean;
681 }
682
683 interface NodeListOptions {
684 abortSignal?: AbortSignal;
685 /**
686 * Filters to process on the nodes list, encoded as JSON (a `map[string][]string`).
687 */
688 filters?: string;
689 }
690
691 interface CPUUsage {
692 percpu_usage: number[];
693 usage_in_usermode: number;
694 total_usage: number;
695 usage_in_kernelmode: number;
696 }
697
698 interface ThrottlingData {
699 periods: number;
700 throttled_periods: number;
701 throttled_time: number;
702 }
703
704 interface CPUStats {
705 cpu_usage: CPUUsage;
706 system_cpu_usage: number;
707 online_cpus: number;
708 throttling_data: ThrottlingData;
709 }
710
711 interface MemoryStats {
712 // Linux Memory Stats
713 stats: {
714 total_pgmajfault: number;
715 cache: number;
716 mapped_file: number;
717 total_inactive_file: number;
718 pgpgout: number;
719 rss: number;
720 total_mapped_file: number;
721 writeback: number;
722 unevictable: number;
723 pgpgin: number;
724 total_unevictable: number;
725 pgmajfault: number;
726 total_rss: number;
727 total_rss_huge: number;
728 total_writeback: number;
729 total_inactive_anon: number;
730 rss_huge: number;
731 hierarchical_memory_limit: number;
732 total_pgfault: number;
733 total_active_file: number;
734 active_anon: number;
735 total_active_anon: number;
736 total_pgpgout: number;
737 total_cache: number;
738 inactive_anon: number;
739 active_file: number;
740 pgfault: number;
741 inactive_file: number;
742 total_pgpgin: number;
743 };
744 max_usage: number;
745 usage: number;
746 failcnt: number;
747 limit: number;
748
749 // Windows Memory Stats
750 commitbytes?: number;
751 commitpeakbytes?: number;
752 privateworkingset?: number;
753 }
754
755 interface BlkioStatEntry {
756 major: number;
757 minor: number;
758 op: string;
759 value: number;
760 }
761
762 interface BlkioStats {
763 io_service_bytes_recursive: BlkioStatEntry[];
764 io_serviced_recursive: BlkioStatEntry[];
765 io_queue_recursive: BlkioStatEntry[];
766 io_service_time_recursive: BlkioStatEntry[];
767 io_wait_time_recursive: BlkioStatEntry[];
768 io_merged_recursive: BlkioStatEntry[];
769 io_time_recursive: BlkioStatEntry[];
770 sectors_recursive: BlkioStatEntry[];
771 }
772
773 interface StorageStats {
774 read_count_normalized?: number;
775 read_size_bytes?: number;
776 write_count_normalized?: number;
777 write_size_bytes?: number;
778 }
779
780 interface PidsStats {
781 current?: number;
782 limit?: number;
783 }
784
785 interface ContainerStats {
786 read: string;
787 preread: string;
788 pids_stats?: PidsStats;
789 blkio_stats?: BlkioStats;
790 num_procs: number;
791 storage_stats?: StorageStats;
792 networks: NetworkStats;
793 memory_stats: MemoryStats;
794 cpu_stats: CPUStats;
795 precpu_stats: CPUStats;
796 }
797
798 interface HostConfig {
799 AutoRemove?: boolean | undefined;
800 Binds?: string[] | undefined;
801 ContainerIDFile?: string | undefined;
802 LogConfig?:
803 | {
804 Type: string;
805 Config: any;
806 }
807 | undefined;
808 NetworkMode?: string | undefined;
809 PortBindings?: any;
810 RestartPolicy?: HostRestartPolicy | undefined;
811 VolumeDriver?: string | undefined;
812 VolumesFrom?: any;
813 Mounts?: MountConfig | undefined;
814 CapAdd?: any;
815 CapDrop?: any;
816 Dns?: any[] | undefined;
817 DnsOptions?: any[] | undefined;
818 DnsSearch?: string[] | undefined;
819 ExtraHosts?: any;
820 GroupAdd?: string[] | undefined;
821 IpcMode?: string | undefined;
822 Cgroup?: string | undefined;
823 Links?: any;
824 OomScoreAdj?: number | undefined;
825 PidMode?: string | undefined;
826 Privileged?: boolean | undefined;
827 PublishAllPorts?: boolean | undefined;
828 ReadonlyRootfs?: boolean | undefined;
829 SecurityOpt?: any;
830 StorageOpt?: { [option: string]: string } | undefined;
831 Tmpfs?: { [dir: string]: string } | undefined;
832 UTSMode?: string | undefined;
833 UsernsMode?: string | undefined;
834 ShmSize?: number | undefined;
835 Sysctls?: { [index: string]: string } | undefined;
836 Runtime?: string | undefined;
837 ConsoleSize?: number[] | undefined;
838 Isolation?: string | undefined;
839 MaskedPaths?: string[] | undefined;
840 ReadonlyPaths?: string[] | undefined;
841 CpuShares?: number | undefined;
842 CgroupParent?: string | undefined;
843 BlkioWeight?: number | undefined;
844 BlkioWeightDevice?: any;
845 BlkioDeviceReadBps?: any;
846 BlkioDeviceWriteBps?: any;
847 BlkioDeviceReadIOps?: any;
848 BlkioDeviceWriteIOps?: any;
849 CpuPeriod?: number | undefined;
850 CpuQuota?: number | undefined;
851 CpusetCpus?: string | undefined;
852 CpusetMems?: string | undefined;
853 Devices?: any;
854 DeviceCgroupRules?: string[] | undefined;
855 DeviceRequests?: DeviceRequest[] | undefined;
856 DiskQuota?: number | undefined;
857 KernelMemory?: number | undefined;
858 Memory?: number | undefined;
859 MemoryReservation?: number | undefined;
860 MemorySwap?: number | undefined;
861 MemorySwappiness?: number | undefined;
862 NanoCpus?: number | undefined;
863 OomKillDisable?: boolean | undefined;
864 Init?: boolean | undefined;
865 PidsLimit?: number | undefined;
866 Ulimits?: Ulimit[] | undefined;
867 CpuCount?: number | undefined;
868 CpuPercent?: number | undefined;
869 CpuRealtimePeriod?: number | undefined;
870 CpuRealtimeRuntime?: number | undefined;
871 }
872
873 interface ImageInspectInfo {
874 Id: string;
875 RepoTags: string[];
876 RepoDigests: string[];
877 Parent: string;
878 Comment: string;
879 Created: string;
880 Container: string;
881 ContainerConfig: {
882 Hostname: string;
883 Domainname: string;
884 User: string;
885 AttachStdin: boolean;
886 AttachStdout: boolean;
887 AttachStderr: boolean;
888 ExposedPorts: { [portAndProtocol: string]: {} };
889 Tty: boolean;
890 OpenStdin: boolean;
891 StdinOnce: boolean;
892 Env: string[];
893 Cmd: string[];
894 ArgsEscaped: boolean;
895 Image: string;
896 Volumes: { [path: string]: {} };
897 WorkingDir: string;
898 Entrypoint?: string | string[] | undefined;
899 OnBuild?: any[] | undefined;
900 Labels: { [label: string]: string };
901 };
902 DockerVersion: string;
903 Author: string;
904 Config: {
905 Hostname: string;
906 Domainname: string;
907 User: string;
908 AttachStdin: boolean;
909 AttachStdout: boolean;
910 AttachStderr: boolean;
911 ExposedPorts: { [portAndProtocol: string]: {} };
912 Tty: boolean;
913 OpenStdin: boolean;
914 StdinOnce: boolean;
915 Env: string[];
916 Cmd: string[];
917 ArgsEscaped: boolean;
918 Image: string;
919 Volumes: { [path: string]: {} };
920 WorkingDir: string;
921 Entrypoint?: string | string[] | undefined;
922 OnBuild: any[];
923 Labels: { [label: string]: string };
924 };
925 Architecture: string;
926 Os: string;
927 Size: number;
928 VirtualSize: number;
929 GraphDriver: {
930 Name: string;
931 Data: {
932 DeviceId: string;
933 DeviceName: string;
934 DeviceSize: string;
935 };
936 };
937 RootFS: {
938 Type: string;
939 Layers?: string[] | undefined;
940 BaseLayer?: string | undefined;
941 };
942 }
943
944 interface ImageBuildOptions {
945 authconfig?: AuthConfig | undefined;
946 registryconfig?: RegistryConfig | undefined;
947 abortSignal?: AbortSignal;
948
949 dockerfile?: string | undefined;
950 t?: string | undefined;
951 extrahosts?: string | undefined;
952 remote?: string | undefined;
953 q?: boolean | undefined;
954 cachefrom?: string | undefined;
955 pull?: string | undefined;
956 rm?: boolean | undefined;
957 forcerm?: boolean | undefined;
958 memory?: number | undefined;
959 memswap?: number | undefined;
960 cpushares?: number | undefined;
961 cpusetcpus?: number | undefined;
962 cpuperiod?: number | undefined;
963 cpuquota?: number | undefined;
964 buildargs?: { [key: string]: string } | undefined;
965 shmsize?: number | undefined;
966 squash?: boolean | undefined;
967 labels?: { [key: string]: string } | undefined;
968 networkmode?: string | undefined;
969 platform?: string | undefined;
970 target?: string | undefined;
971 outputs?: string | undefined;
972 nocache?: boolean | undefined;
973 }
974
975 interface ImageDistributionOptions {
976 authconfig?: AuthConfig | undefined;
977 abortSignal?: AbortSignal;
978 }
979
980 interface ImagePushOptions {
981 tag?: string | undefined;
982 authconfig?: AuthConfig | undefined;
983 abortSignal?: AbortSignal;
984 }
985
986 interface ImageTagOptions {
987 abortSignal?: AbortSignal;
988 /**
989 * The repository to tag in. For example, someuser/someimage.
990 */
991 repo: string;
992 /**
993 * The name of the new tag.
994 */
995 tag?: string;
996 }
997
998 interface AuthConfig {
999 username: string;
1000 password: string;
1001 serveraddress: string;
1002 email?: string | undefined;
1003 }
1004
1005 interface RegistryConfig {
1006 [registryAddress: string]: {
1007 username: string;
1008 password: string;
1009 };
1010 }
1011
1012 interface PortBinding {
1013 HostIp?: string | undefined;
1014 HostPort?: string | undefined;
1015 }
1016
1017 interface PortMap {
1018 [key: string]: PortBinding[];
1019 }
1020
1021 interface HostRestartPolicy {
1022 Name: string;
1023 MaximumRetryCount?: number | undefined;
1024 }
1025
1026 type LoggingDriverType =
1027 | "json-file"
1028 | "syslog"
1029 | "journald"
1030 | "gelf"
1031 | "fluentd"
1032 | "awslogs"
1033 | "splunk"
1034 | "etwlogs"
1035 | "none";
1036
1037 interface LogConfig {
1038 Type: LoggingDriverType;
1039 Config?: { [key: string]: string } | undefined;
1040 }
1041
1042 interface DeviceMapping {
1043 PathOnHost: string;
1044 PathInContainer: string;
1045 CgroupPermissions: string;
1046 }
1047
1048 interface DeviceRequest {
1049 Driver?: string | undefined;
1050 Count?: number | undefined;
1051 DeviceIDs?: string[] | undefined;
1052 Capabilities?: string[][] | undefined;
1053 Options?: { [key: string]: string } | undefined;
1054 }
1055
1056 /* tslint:disable:interface-name */
1057 interface IPAMConfig {
1058 IPv4Address?: string | undefined;
1059 IPv6Address?: string | undefined;
1060 LinkLocalIPs?: string[] | undefined;
1061 }
1062 /* tslint:enable:interface-name */
1063
1064 interface EndpointSettings {
1065 IPAMConfig?: IPAMConfig | undefined;
1066 Links?: string[] | undefined;
1067 Aliases?: string[] | undefined;
1068 NetworkID?: string | undefined;
1069 EndpointID?: string | undefined;
1070 Gateway?: string | undefined;
1071 IPAddress?: string | undefined;
1072 IPPrefixLen?: number | undefined;
1073 IPv6Gateway?: string | undefined;
1074 GlobalIPv6Address?: string | undefined;
1075 GlobalIPV6PrefixLen?: number | undefined;
1076 MacAddress?: string | undefined;
1077 DriverOpts?: { [key: string]: string } | undefined;
1078 }
1079
1080 interface EndpointsConfig {
1081 [key: string]: EndpointSettings;
1082 }
1083
1084 interface ExecCreateOptions {
1085 AttachStdin?: boolean | undefined;
1086 AttachStdout?: boolean | undefined;
1087 AttachStderr?: boolean | undefined;
1088 DetachKeys?: string | undefined;
1089 Tty?: boolean | undefined;
1090 Env?: string[] | undefined;
1091 Cmd?: string[] | undefined;
1092 Privileged?: boolean | undefined;
1093 User?: string | undefined;
1094 WorkingDir?: string | undefined;
1095 abortSignal?: AbortSignal;
1096 }
1097
1098 interface ExecInspectInfo {
1099 CanRemove: boolean;
1100 DetachKeys: string;
1101 ID: string;
1102 Running: boolean;
1103 ExitCode: number | null;
1104 ProcessConfig: {
1105 privileged: boolean;
1106 user: string;
1107 tty: boolean;
1108 entrypoint: string;
1109 arguments: string[];
1110 };
1111 OpenStdin: boolean;
1112 OpenStderr: boolean;
1113 OpenStdout: boolean;
1114 ContainerID: string;
1115 Pid: number;
1116 }
1117
1118 interface ExecInspectOptions {
1119 abortSignal?: AbortSignal;
1120 }
1121
1122 interface ExecStartOptions {
1123 // hijack and stdin are used by docker-modem
1124 hijack?: boolean | undefined;
1125 stdin?: boolean | undefined;
1126 // Detach and Tty are used by Docker's API
1127 Detach?: boolean | undefined;
1128 Tty?: boolean | undefined;
1129 abortSignal?: AbortSignal;
1130 }
1131
1132 type MountType = "bind" | "volume" | "tmpfs";
1133
1134 type MountConsistency = "default" | "consistent" | "cached" | "delegated";
1135
1136 type MountPropagation = "private" | "rprivate" | "shared" | "rshared" | "slave" | "rslave";
1137
1138 interface MountSettings {
1139 Target: string;
1140 Source: string;
1141 Type: MountType;
1142 ReadOnly?: boolean | undefined;
1143 Consistency?: MountConsistency | undefined;
1144 BindOptions?:
1145 | {
1146 Propagation: MountPropagation;
1147 }
1148 | undefined;
1149 VolumeOptions?:
1150 | {
1151 NoCopy: boolean;
1152 Labels: { [label: string]: string };
1153 DriverConfig: {
1154 Name: string;
1155 Options: { [option: string]: string };
1156 };
1157 }
1158 | undefined;
1159 TmpfsOptions?:
1160 | {
1161 SizeBytes: number;
1162 Mode: number;
1163 }
1164 | undefined;
1165 }
1166
1167 type MountConfig = MountSettings[];
1168
1169 interface ContainerCreateOptions {
1170 name?: string | undefined;
1171 platform?: string | undefined;
1172 Hostname?: string | undefined;
1173 Domainname?: string | undefined;
1174 User?: string | undefined;
1175 ArgsEscaped?: boolean | undefined;
1176 AttachStdin?: boolean | undefined;
1177 AttachStdout?: boolean | undefined;
1178 AttachStderr?: boolean | undefined;
1179 Tty?: boolean | undefined;
1180 OpenStdin?: boolean | undefined;
1181 StdinOnce?: boolean | undefined;
1182 Env?: string[] | undefined;
1183 Cmd?: string[] | undefined;
1184 Entrypoint?: string | string[] | undefined;
1185 Image?: string | undefined;
1186 Labels?: { [label: string]: string } | undefined;
1187 Volumes?: { [volume: string]: {} } | undefined;
1188 WorkingDir?: string | undefined;
1189 NetworkDisabled?: boolean | undefined;
1190 MacAddress?: string | undefined;
1191 ExposedPorts?: { [port: string]: {} } | undefined;
1192 StopSignal?: string | undefined;
1193 StopTimeout?: number | undefined;
1194 Healthcheck?: HealthConfig | undefined;
1195 HostConfig?: HostConfig | undefined;
1196 OnBuild?: string[] | undefined;
1197 Shell?: string[] | undefined;
1198 NetworkingConfig?:
1199 | {
1200 EndpointsConfig?: EndpointsConfig | undefined;
1201 }
1202 | undefined;
1203 abortSignal?: AbortSignal;
1204 }
1205
1206 interface ContainerInspectOptions {
1207 abortSignal?: AbortSignal;
1208 }
1209
1210 interface ContainerStartOptions {
1211 detachKeys?: string;
1212 abortSignal?: AbortSignal;
1213 }
1214
1215 interface ContainerRemoveOptions {
1216 v?: boolean | undefined;
1217 force?: boolean | undefined;
1218 link?: boolean | undefined;
1219 }
1220
1221 interface KeyObject {
1222 pem: string | Buffer;
1223 passphrase?: string | undefined;
1224 }
1225
1226 interface DockerOptions {
1227 socketPath?: string | undefined;
1228 host?: string | undefined;
1229 port?: number | string | undefined;
1230 username?: string | undefined;
1231 headers?: { [name: string]: string };
1232 ca?: string | string[] | Buffer | Buffer[] | undefined;
1233 cert?: string | string[] | Buffer | Buffer[] | undefined;
1234 key?: string | string[] | Buffer | Buffer[] | KeyObject[] | undefined;
1235 protocol?: "https" | "http" | "ssh" | undefined;
1236 timeout?: number | undefined;
1237 version?: string | undefined;
1238 sshAuthAgent?: string | undefined;
1239 Promise?: typeof Promise | undefined;
1240 }
1241
1242 interface GetEventsOptions {
1243 since?: number | undefined;
1244 until?: number | undefined;
1245 filters?:
1246 | string
1247 | {
1248 config?: string | undefined;
1249 container?: string[] | undefined;
1250 daemon?: string[] | undefined;
1251 event?: string[] | undefined;
1252 image?: string[] | undefined;
1253 label?: string[] | undefined;
1254 network?: string[] | undefined;
1255 node?: string[] | undefined;
1256 plugin?: string[] | undefined;
1257 scope?: Array<"local" | "swarm"> | undefined;
1258 secret?: string[] | undefined;
1259 service?: string[] | undefined;
1260 type?:
1261 | Array<
1262 | "container"
1263 | "image"
1264 | "volume"
1265 | "network"
1266 | "daemon"
1267 | "plugin"
1268 | "service"
1269 | "node"
1270 | "secret"
1271 | "config"
1272 >
1273 | undefined;
1274 volume?: string[] | undefined;
1275 }
1276 | undefined;
1277 abortSignal?: AbortSignal;
1278 }
1279
1280 interface SecretVersion {
1281 Index: number;
1282 }
1283
1284 interface Annotations {
1285 Name?: string | undefined;
1286 Labels?: { [name: string]: string } | undefined;
1287 }
1288
1289 interface ResourceLimits {
1290 NanoCPUs?: number | undefined;
1291 MemoryBytes?: number | undefined;
1292 Pids?: number | undefined;
1293 }
1294
1295 interface NamedGenericResource {
1296 Kind?: string | undefined;
1297 Value?: string | undefined;
1298 }
1299
1300 interface DiscreteGenericResource {
1301 Kind?: string | undefined;
1302 Value?: number | undefined;
1303 }
1304
1305 type GenericResource = NamedGenericResource | DiscreteGenericResource;
1306
1307 interface TaskRestartPolicy {
1308 Condition?: string | undefined;
1309 Delay?: number | undefined;
1310 MaxAttempts?: number | undefined;
1311 Window?: number | undefined;
1312 }
1313
1314 interface Resources {
1315 NanoCPUs?: number | undefined;
1316 MemoryBytes?: number | undefined;
1317 GenericResources?: GenericResource[] | undefined;
1318 }
1319
1320 interface ResourceRequirements {
1321 Limits?: ResourceLimits | undefined;
1322 Reservations?: Resources | undefined;
1323 }
1324
1325 interface Placement {
1326 Constraints?: string[] | undefined;
1327 Preferences?: Array<{ Spread: { SpreadDescriptor: string } }> | undefined;
1328 MaxReplicas?: number | undefined;
1329 Platforms?:
1330 | Array<{
1331 Architecture: string;
1332 OS: string;
1333 }>
1334 | undefined;
1335 }
1336
1337 interface NetworkAttachmentConfig {
1338 Target?: string | undefined;
1339 Aliases?: string[] | undefined;
1340 DriverOpts?: { [key: string]: string } | undefined;
1341 }
1342
1343 interface Privileges {
1344 CredentialSpec?:
1345 | {
1346 Config?: string | undefined;
1347 File?: string | undefined;
1348 Registry?: string | undefined;
1349 }
1350 | undefined;
1351 SELinuxContext?:
1352 | {
1353 Disable?: boolean | undefined;
1354 User?: string | undefined;
1355 Role?: string | undefined;
1356 Type?: string | undefined;
1357 Level?: string | undefined;
1358 }
1359 | undefined;
1360 }
1361
1362 interface HealthConfig {
1363 Test?: string[] | undefined;
1364 Interval?: number | undefined;
1365 Timeout?: number | undefined;
1366 StartPeriod?: number | undefined;
1367 Retries?: number | undefined;
1368 }
1369
1370 interface DNSConfig {
1371 Nameservers?: string[] | undefined;
1372 Search?: string[] | undefined;
1373 Options?: string[] | undefined;
1374 }
1375
1376 interface ConfigReference {
1377 File?:
1378 | {
1379 Name?: string | undefined;
1380 UID?: string | undefined;
1381 GID?: string | undefined;
1382 Mode: number | undefined;
1383 }
1384 | undefined;
1385 ConfigID?: string | undefined;
1386 ConfigName?: string | undefined;
1387 }
1388
1389 interface SecretReference {
1390 File?:
1391 | {
1392 Name?: string | undefined;
1393 UID?: string | undefined;
1394 GID?: string | undefined;
1395 Mode?: number | undefined;
1396 }
1397 | undefined;
1398 SecretID?: string | undefined;
1399 SecretName?: string | undefined;
1400 }
1401
1402 interface Ulimit {
1403 Name?: string | undefined;
1404 Hard?: number | undefined;
1405 Soft?: number | undefined;
1406 }
1407
1408 interface ContainerSpec {
1409 Image?: string | undefined;
1410 Labels?: { [label: string]: string } | undefined;
1411 Command?: string[] | undefined;
1412 Args?: string[] | undefined;
1413 Hostname?: string | undefined;
1414 Env?: string[] | undefined;
1415 Dir?: string | undefined;
1416 User?: string | undefined;
1417 Groups?: string[] | undefined;
1418 Privileges?: Privileges | undefined;
1419 Init?: boolean | undefined;
1420 TTY?: boolean | undefined;
1421 OpenStdin?: boolean | undefined;
1422 ReadOnly?: boolean | undefined;
1423 Mounts?: MountSettings[] | undefined;
1424 StopSignal?: string | undefined;
1425 StopGracePeriod?: number | undefined;
1426 HealthCheck?: HealthConfig | undefined;
1427 Hosts?: string[] | undefined;
1428 DNSConfig?: DNSConfig | undefined;
1429 Configs?: ConfigReference[] | undefined;
1430 Secrets?: SecretReference[] | undefined;
1431 Isolation?: string | undefined;
1432 Sysctls?: { [key: string]: string } | undefined;
1433 CapabilityAdd?: string[] | undefined;
1434 CapabilityDrop?: string[] | undefined;
1435 Ulimits?: Ulimit[] | undefined;
1436 }
1437
1438 interface PluginSpec {
1439 Name?: string | undefined;
1440 Remote?: string | undefined;
1441 Privileges?:
1442 | {
1443 Name?: string | undefined;
1444 Description?: string | undefined;
1445 Value?: string[] | undefined;
1446 }
1447 | undefined;
1448 Disabled?: boolean | undefined;
1449 Env?: string[] | undefined;
1450 }
1451
1452 interface TaskSpecBase {
1453 Resources?: ResourceRequirements | undefined;
1454 RestartPolicy?: TaskRestartPolicy | undefined;
1455 Placement?: Placement | undefined;
1456 Networks?: NetworkAttachmentConfig[] | undefined;
1457 LogDriver?:
1458 | {
1459 Name?: string | undefined;
1460 Options?: { [key: string]: string } | undefined;
1461 }
1462 | undefined;
1463 ForceUpdate?: number | undefined;
1464 Runtime?: string | undefined;
1465 }
1466
1467 interface ContainerTaskSpec extends TaskSpecBase {
1468 ContainerSpec?: ContainerSpec | undefined;
1469 }
1470
1471 interface PluginTaskSpec extends TaskSpecBase {
1472 Runtime: "plugin";
1473 PluginSpec: PluginSpec;
1474 }
1475
1476 interface NetworkAttachmentTaskSpec extends TaskSpecBase {
1477 Runtime: "attachment";
1478 NetworkAttachmentSpec: {
1479 ContainerID: string;
1480 };
1481 }
1482
1483 type TaskSpec = ContainerTaskSpec | PluginTaskSpec | NetworkAttachmentTaskSpec;
1484
1485 interface ServiceMode {
1486 Replicated?: { Replicas?: number | undefined } | undefined;
1487 Global?: {} | undefined;
1488 ReplicatedJob?:
1489 | {
1490 MaxConcurrent?: number | undefined;
1491 TotalCompletions?: number | undefined;
1492 }
1493 | undefined;
1494 GlobalJob?: {} | undefined;
1495 }
1496
1497 interface UpdateConfig {
1498 Parallelism: number;
1499 Delay?: number | undefined;
1500 FailureAction?: string | undefined;
1501 Monitor?: number | undefined;
1502 MaxFailureRatio?: number | undefined;
1503 Order: string;
1504 }
1505
1506 interface PortConfig {
1507 Name?: string | undefined;
1508 Protocol?: "tcp" | "udp" | "sctp" | undefined;
1509 TargetPort?: number | undefined;
1510 PublishedPort?: number | undefined;
1511 PublishMode?: "ingress" | "host" | undefined;
1512 }
1513
1514 interface EndpointSpec {
1515 Mode?: string | undefined;
1516 Ports?: PortConfig[] | undefined;
1517 }
1518
1519 interface EndpointVirtualIP {
1520 NetworkID?: string | undefined;
1521 Addr?: string | undefined;
1522 }
1523
1524 interface Endpoint {
1525 Spec?: EndpointSpec | undefined;
1526 Ports?: PortConfig[] | undefined;
1527 VirtualIPs?: EndpointVirtualIP[] | undefined;
1528 }
1529
1530 interface ServiceSpec extends Annotations {
1531 TaskTemplate?: TaskSpec | undefined;
1532 Mode?: ServiceMode | undefined;
1533 UpdateConfig?: UpdateConfig | undefined;
1534 RollbackConfig?: UpdateConfig | undefined;
1535 Networks?: NetworkAttachmentConfig[] | undefined;
1536 EndpointSpec?: EndpointSpec | undefined;
1537 }
1538
1539 interface CreateServiceOptions extends ServiceSpec {
1540 authconfig?: AuthConfig | undefined;
1541 abortSignal?: AbortSignal;
1542 }
1543
1544 interface ContainerListOptions {
1545 abortSignal?: AbortSignal;
1546 /**
1547 * Return all containers. By default, only running containers are shown
1548 * @default false
1549 */
1550 all?: boolean;
1551 /**
1552 * Return this number of most recently created containers, including non-running ones.
1553 */
1554 limit?: number;
1555 /**
1556 * Return the size of container as fields `SizeRw` and `SizeRootFs`.
1557 * @default false
1558 */
1559 size?: boolean;
1560 /**
1561 * Filters to process on the container list, encoded as JSON (a map[string][]string).
1562 */
1563 filters?: string;
1564 }
1565
1566 interface ServiceListOptions {
1567 filters?:
1568 | {
1569 id?: string[] | undefined;
1570 label?: string[] | undefined;
1571 mode?: Array<"replicated" | "global"> | undefined;
1572 name?: string[] | undefined;
1573 }
1574 | string
1575 | undefined;
1576 status?: boolean | undefined;
1577 abortSignal?: AbortSignal;
1578 }
1579
1580 interface Version {
1581 Index?: number | undefined;
1582 }
1583
1584 interface Meta {
1585 Version?: Version | undefined;
1586 CreatedAt?: string | undefined;
1587 UpdatedAt?: string | undefined;
1588 }
1589
1590 type UpdateState =
1591 | "updating"
1592 | "paused"
1593 | "completed"
1594 | "rollback_started"
1595 | "rollback_paused"
1596 | "rollback_completed";
1597
1598 interface UpdateStatus {
1599 State?: UpdateState | undefined;
1600 StartedAt?: string | undefined;
1601 CompletedAt?: string | undefined;
1602 Message?: string | undefined;
1603 }
1604
1605 interface ServiceStatus {
1606 RunningTasks: number;
1607 DesiredTasks: number;
1608 CompletedTasks: number;
1609 }
1610
1611 interface JobStatus {
1612 JobIteration: Version;
1613 LastExecution?: string | undefined;
1614 }
1615
1616 interface Service extends Meta {
1617 ID: string;
1618 Spec?: ServiceSpec | undefined;
1619 PreviousSpec?: ServiceSpec | undefined;
1620 Endpoint?: Endpoint | undefined;
1621 UpdateStatus?: UpdateStatus | undefined;
1622 ServiceStatus?: ServiceStatus | undefined;
1623 JobStatus?: JobStatus | undefined;
1624 }
1625
1626 interface OrchestrationConfig {
1627 TaskHistoryRetentionLimit?: number | undefined;
1628 }
1629
1630 interface RaftConfig {
1631 SnapshotInterval?: number | undefined;
1632 KeepOldSnapshots?: number | undefined;
1633 LogEntriesForSlowFollowers?: number | undefined;
1634 ElectionTick?: number | undefined;
1635 HeartbeatTick?: number | undefined;
1636 }
1637
1638 interface DispatcherConfig {
1639 HeartbeatPeriod?: Duration | undefined;
1640 }
1641
1642 type ExternalCAProtocol = "cfssl" | string;
1643
1644 interface ExternalCA {
1645 Protocol: ExternalCAProtocol;
1646 URL: string;
1647 Options?: { [key: string]: string } | undefined;
1648 CACert: string;
1649 }
1650
1651 interface CAConfig {
1652 NodeCertExpiry?: Duration | undefined;
1653 ExternalCAs?: ExternalCA[] | undefined;
1654 SigningCACert?: string | undefined;
1655 SigningCAKey?: string | undefined;
1656 ForceRotate?: number | undefined;
1657 }
1658
1659 interface TaskDefaults {
1660 LogDriver?: Driver | undefined;
1661 }
1662
1663 interface EncryptionConfig {
1664 AutoLockManagers: boolean;
1665 }
1666
1667 interface Spec extends Annotations {
1668 Orchestration?: OrchestrationConfig | undefined;
1669 Raft: RaftConfig;
1670 Dispatcher?: DispatcherConfig | undefined;
1671 CAConfig?: CAConfig | undefined;
1672 TaskDefaults?: TaskDefaults | undefined;
1673 EncryptionConfig?: EncryptionConfig | undefined;
1674 }
1675
1676 interface TLSInfo {
1677 TrustRoot?: string | undefined;
1678 CertIssuerSubject?: string | undefined;
1679 CertIssuerPublicKey?: string | undefined;
1680 }
1681
1682 interface ClusterInfo extends Meta {
1683 ID: string;
1684 Spec: Spec;
1685 TLSInfo: TLSInfo;
1686 RootRotationInProgress: boolean;
1687 DefaultAddrPool: string[];
1688 SubnetSize: number;
1689 DataPathPort: number;
1690 }
1691
1692 interface JoinTokens {
1693 Worker: string;
1694 Manager: string;
1695 }
1696
1697 interface Swarm extends ClusterInfo {
1698 JoinTokens: JoinTokens;
1699 }
1700
1701 interface Driver {
1702 Name: string;
1703 Options?: { [key: string]: string } | undefined;
1704 }
1705
1706 interface SecretSpec extends Annotations {
1707 Data?: string | undefined;
1708 Driver?: Driver | undefined;
1709 Templating?: Driver | undefined;
1710 }
1711
1712 interface Secret extends Meta {
1713 ID: string;
1714 Spec?: SecretSpec | undefined;
1715 }
1716
1717 interface ConfigInfo {
1718 ID: string;
1719 Version: SecretVersion;
1720 CreatedAt: string;
1721 UpdatedAt?: string | undefined;
1722 Spec?: ConfigSpec | undefined;
1723 }
1724
1725 interface ConfigSpec {
1726 Name: string;
1727 Labels: { [label: string]: string };
1728 Data: string;
1729 }
1730
1731 interface ConfigVersion {
1732 Index: number;
1733 }
1734
1735 interface PluginInfo {
1736 Id?: string | undefined;
1737 Name: string;
1738 Enabled: boolean;
1739 Settings: PluginSettings;
1740 PluginReference?: string | undefined;
1741 Config: PluginConfig;
1742 }
1743
1744 type PluginInspectInfo = PluginInfo;
1745
1746 interface PluginSettings {
1747 Mounts: PluginMount[];
1748 Env: string[];
1749 Args: string[];
1750 Devices: PluginDevice[];
1751 }
1752
1753 interface PluginConfig {
1754 Description: string;
1755 Documentation: string;
1756 Interface: any;
1757 Entrypoint: string[];
1758 WorkDir: string;
1759 User?: User | undefined;
1760 Network: Network;
1761 Linux: Linux;
1762 PropagatedMount: string;
1763 Mounts: PluginMount[];
1764 Env: PluginEnv[];
1765 Args: Args;
1766 rootfs: any;
1767 }
1768
1769 interface Interface {
1770 Types: PluginInterfaceType[];
1771 Socket: string;
1772 }
1773
1774 interface PluginInterfaceType {
1775 Prefix: string;
1776 Capability: string;
1777 Version: string;
1778 }
1779
1780 interface PluginMount {
1781 Name: string;
1782 Description: string;
1783 Settable: string[];
1784 Source: string;
1785 Destination: string;
1786 Type: string;
1787 Options: string[];
1788 }
1789
1790 interface Linux {
1791 Capabilities: string[];
1792 AllowAllDevices: boolean;
1793 Devices: PluginDevice[];
1794 }
1795
1796 interface PluginDevice {
1797 Name: string;
1798 Description: string;
1799 Settable: string[];
1800 Path: string;
1801 }
1802
1803 interface Network {
1804 Type: string;
1805 }
1806
1807 interface PluginEnv {
1808 Name: string;
1809 Description: string;
1810 Settable: string[];
1811 Value: string;
1812 }
1813
1814 interface Args {
1815 Name: string;
1816 Description: string;
1817 Settable: string[];
1818 Value: string;
1819 }
1820
1821 interface User {
1822 UID: number;
1823 GID: number;
1824 }
1825
1826 interface ListImagesOptions {
1827 all?: boolean | undefined;
1828 filters?: string | undefined;
1829 digests?: boolean | undefined;
1830 abortSignal?: AbortSignal;
1831 }
1832
1833 interface ImageDistributionPlatformInfo {
1834 architecture: string;
1835 os: string;
1836 "os.version": string;
1837 "os.features": string[];
1838 variant: string;
1839 }
1840
1841 interface ImageDistributionDescriptorInfo {
1842 mediaType: string;
1843 digest: string;
1844 size: number;
1845 }
1846
1847 interface ImageDistributionInfo {
1848 Descriptor: ImageDistributionDescriptorInfo;
1849 Platforms: ImageDistributionPlatformInfo[];
1850 }
1851
1852 interface ImageRemoveInfo {
1853 Untagged: string;
1854 Deleted: string;
1855 }
1856
1857 interface ImageRemoveOptions {
1858 force?: boolean | undefined;
1859 noprune?: boolean | undefined;
1860 abortSignal?: AbortSignal;
1861 }
1862
1863 interface PruneImagesInfo {
1864 ImagesDeleted: ImageRemoveInfo[];
1865 SpaceReclaimed: number;
1866 }
1867
1868 interface PruneVolumesInfo {
1869 VolumesDeleted: string[];
1870 SpaceReclaimed: number;
1871 }
1872
1873 interface PruneContainersInfo {
1874 ContainersDeleted: string[];
1875 SpaceReclaimed: number;
1876 }
1877
1878 interface PruneNetworksInfo {
1879 NetworksDeleted: string[];
1880 }
1881
1882 interface ContainerWaitOptions {
1883 /** Since v1.30 */
1884 condition?: "not-running" | "next-exit" | "removed" | undefined;
1885 abortSignal?: AbortSignal;
1886 }
1887
1888 interface ContainerLogsOptions {
1889 stdout?: boolean | undefined;
1890 stderr?: boolean | undefined;
1891 follow?: boolean | undefined;
1892 since?: number | string | undefined;
1893 until?: number | string | undefined;
1894 details?: boolean | undefined;
1895 tail?: number | undefined;
1896 timestamps?: boolean | undefined;
1897 abortSignal?: AbortSignal;
1898 }
1899
1900 interface ContainerAttachOptions {
1901 detachKeys?: string | undefined;
1902 hijack?: boolean | undefined;
1903 logs?: boolean | undefined;
1904 stream?: boolean | undefined;
1905 stdin?: boolean | undefined;
1906 stdout?: boolean | undefined;
1907 stderr?: boolean | undefined;
1908 abortSignal?: AbortSignal;
1909 }
1910
1911 interface ContainerStopOptions {
1912 signal?: string;
1913 /** Number of seconds to wait before killing the container */
1914 t?: number;
1915 abortSignal?: AbortSignal;
1916 }
1917
1918 interface ImageBuildContext {
1919 context: string;
1920 src: string[];
1921 }
1922
1923 interface DockerVersion {
1924 ApiVersion: string;
1925 Arch: string;
1926 BuildTime: Date;
1927 Components: Array<{
1928 Details: {
1929 ApiVersion: string;
1930 Arch: string;
1931 BuildTime: Date;
1932 Experimental: string;
1933 GitCommit: string;
1934 GoVersion: string;
1935 KernelVersion: string;
1936 Os: string;
1937 };
1938 Name: string;
1939 Version: string;
1940 }>;
1941 GitCommit: string;
1942 GoVersion: string;
1943 KernelVersion: string;
1944 MinAPIVersion: string;
1945 Os: string;
1946 Platform: {
1947 Name: string;
1948 };
1949 Version: string;
1950 }
1951}
1952
1953type Callback<T> = (error?: any, result?: T) => void;
1954
1955declare class Dockerode {
1956 constructor(options?: Dockerode.DockerOptions);
1957
1958 createContainer(options: Dockerode.ContainerCreateOptions, callback: Callback<Dockerode.Container>): void;
1959 createContainer(options: Dockerode.ContainerCreateOptions): Promise<Dockerode.Container>;
1960
1961 createImage(options: {}, callback: Callback<NodeJS.ReadableStream>): void;
1962 createImage(auth: any, options: {}, callback: Callback<NodeJS.ReadableStream>): void;
1963 createImage(options: {}): Promise<NodeJS.ReadableStream>;
1964 createImage(auth: any, options: {}): Promise<NodeJS.ReadableStream>;
1965
1966 loadImage(file: string | NodeJS.ReadableStream, options: {}, callback: Callback<NodeJS.ReadableStream>): void;
1967 loadImage(file: string | NodeJS.ReadableStream, callback: Callback<NodeJS.ReadableStream>): void;
1968 loadImage(file: string | NodeJS.ReadableStream, options?: {}): Promise<NodeJS.ReadableStream>;
1969
1970 importImage(file: string | NodeJS.ReadableStream, options: {}, callback: Callback<NodeJS.ReadableStream>): void;
1971 importImage(file: string | NodeJS.ReadableStream, callback: Callback<NodeJS.ReadableStream>): void;
1972 importImage(file: string | NodeJS.ReadableStream, options?: {}): Promise<NodeJS.ReadableStream>;
1973
1974 checkAuth(options: any, callback: Callback<any>): void;
1975 checkAuth(options: any): Promise<any>;
1976
1977 buildImage(
1978 file: string | NodeJS.ReadableStream | Dockerode.ImageBuildContext,
1979 options: Dockerode.ImageBuildOptions,
1980 callback: Callback<NodeJS.ReadableStream>,
1981 ): void;
1982 buildImage(
1983 file: string | NodeJS.ReadableStream | Dockerode.ImageBuildContext,
1984 callback: Callback<NodeJS.ReadableStream>,
1985 ): void;
1986 buildImage(
1987 file: string | NodeJS.ReadableStream | Dockerode.ImageBuildContext,
1988 options?: Dockerode.ImageBuildOptions,
1989 ): Promise<NodeJS.ReadableStream>;
1990
1991 getContainer(id: string): Dockerode.Container;
1992
1993 getImage(name: string): Dockerode.Image;
1994
1995 getVolume(name: string): Dockerode.Volume;
1996
1997 getPlugin(name: string, remote: any): Dockerode.Plugin;
1998
1999 getService(id: string): Dockerode.Service;
2000
2001 getTask(id: string): Dockerode.Task;
2002
2003 getNode(id: string): Dockerode.Node;
2004
2005 getNetwork(id: string): Dockerode.Network;
2006
2007 getSecret(id: string): Dockerode.Secret;
2008
2009 getExec(id: string): Dockerode.Exec;
2010
2011 getConfig(id: string): Dockerode.Config;
2012
2013 listContainers(options: Dockerode.ContainerListOptions, callback: Callback<Dockerode.ContainerInfo[]>): void;
2014 listContainers(callback: Callback<Dockerode.ContainerInfo[]>): void;
2015 listContainers(options?: Dockerode.ContainerListOptions): Promise<Dockerode.ContainerInfo[]>;
2016
2017 listImages(options: Dockerode.ListImagesOptions, callback: Callback<Dockerode.ImageInfo[]>): void;
2018 listImages(callback: Callback<Dockerode.ImageInfo[]>): void;
2019 listImages(options?: Dockerode.ListImagesOptions): Promise<Dockerode.ImageInfo[]>;
2020
2021 listServices(options: Dockerode.ServiceListOptions, callback: Callback<Dockerode.Service[]>): void;
2022 listServices(callback: Callback<Dockerode.Service[]>): void;
2023 listServices(options?: Dockerode.ServiceListOptions): Promise<Dockerode.Service[]>;
2024
2025 listNodes(options: Dockerode.NodeListOptions, callback: Callback<any[]>): void;
2026 listNodes(callback: Callback<any[]>): void;
2027 listNodes(options?: Dockerode.NodeListOptions): Promise<any[]>;
2028
2029 listTasks(options: {}, callback: Callback<any[]>): void;
2030 listTasks(callback: Callback<any[]>): void;
2031 listTasks(options?: {}): Promise<any[]>;
2032
2033 listSecrets(options: {}, callback: Callback<Dockerode.Secret[]>): void;
2034 listSecrets(callback: Callback<Dockerode.Secret[]>): void;
2035 listSecrets(options?: {}): Promise<Dockerode.Secret[]>;
2036
2037 listPlugins(options: {}, callback: Callback<Dockerode.PluginInfo[]>): void;
2038 listPlugins(callback: Callback<Dockerode.PluginInfo[]>): void;
2039 listPlugins(options?: {}): Promise<Dockerode.PluginInfo[]>;
2040
2041 listVolumes(
2042 options: Dockerode.VolumeListOptions,
2043 callback: Callback<{
2044 Volumes: Dockerode.VolumeInspectInfo[];
2045 Warnings: string[];
2046 }>,
2047 ): void;
2048 listVolumes(
2049 callback: Callback<{
2050 Volumes: Dockerode.VolumeInspectInfo[];
2051 Warnings: string[];
2052 }>,
2053 ): void;
2054 listVolumes(options?: Dockerode.VolumeListOptions): Promise<{
2055 Volumes: Dockerode.VolumeInspectInfo[];
2056 Warnings: string[];
2057 }>;
2058
2059 listNetworks(options: Dockerode.NetworkListOptions, callback: Callback<Dockerode.NetworkInspectInfo[]>): void;
2060 listNetworks(callback: Callback<Dockerode.NetworkInspectInfo[]>): void;
2061 listNetworks(options?: Dockerode.NetworkListOptions): Promise<Dockerode.NetworkInspectInfo[]>;
2062
2063 listConfigs(options: {}, callback: Callback<Dockerode.ConfigInfo[]>): void;
2064 listConfigs(callback: Callback<Dockerode.ConfigInfo[]>): void;
2065 listConfigs(options?: {}): Promise<Dockerode.ConfigInfo[]>;
2066
2067 createSecret(options: {}, callback: Callback<any>): void;
2068 createSecret(options: {}): Promise<any>;
2069
2070 createConfig(options: {}, callback: Callback<any>): void;
2071 createConfig(options: {}): Promise<any>;
2072
2073 createPlugin(options: {}, callback: Callback<any>): void;
2074 createPlugin(options: {}): Promise<any>;
2075
2076 createVolume(options: Dockerode.VolumeCreateOptions, callback: Callback<Dockerode.Volume>): void;
2077 createVolume(callback: Callback<Dockerode.Volume>): void;
2078 createVolume(options?: Dockerode.VolumeCreateOptions): Promise<Dockerode.VolumeCreateResponse>;
2079
2080 createService(options: Dockerode.CreateServiceOptions, callback: Callback<Dockerode.Service>): void;
2081 createService(options: Dockerode.CreateServiceOptions): Promise<Dockerode.Service>;
2082 createService(auth: Dockerode.AuthConfig, options: Dockerode.ServiceSpec): Promise<Dockerode.Service>;
2083
2084 createNetwork(options: Dockerode.NetworkCreateOptions, callback: Callback<Dockerode.Network>): void;
2085 createNetwork(options: Dockerode.NetworkCreateOptions): Promise<Dockerode.Network>;
2086
2087 searchImages(options: {}, callback: Callback<any>): void;
2088 searchImages(options: {}): Promise<any>;
2089
2090 pruneImages(options: {}, callback: Callback<Dockerode.PruneImagesInfo>): void;
2091 pruneImages(callback: Callback<Dockerode.PruneImagesInfo>): void;
2092 pruneImages(options?: {}): Promise<Dockerode.PruneImagesInfo>;
2093
2094 pruneContainers(options: {}, callback: Callback<Dockerode.PruneContainersInfo>): void;
2095 pruneContainers(callback: Callback<Dockerode.PruneContainersInfo>): void;
2096 pruneContainers(options?: {}): Promise<Dockerode.PruneContainersInfo>;
2097
2098 pruneVolumes(options: Dockerode.VolumePruneOptions, callback: Callback<Dockerode.PruneVolumesInfo>): void;
2099 pruneVolumes(callback: Callback<Dockerode.PruneVolumesInfo>): void;
2100 pruneVolumes(options?: Dockerode.VolumePruneOptions): Promise<Dockerode.PruneVolumesInfo>;
2101
2102 pruneNetworks(options: {}, callback: Callback<Dockerode.PruneNetworksInfo>): void;
2103 pruneNetworks(callback: Callback<Dockerode.PruneNetworksInfo>): void;
2104 pruneNetworks(options?: {}): Promise<Dockerode.PruneNetworksInfo>;
2105
2106 info(callback: Callback<any>): void;
2107 info(): Promise<any>;
2108
2109 df(callback: Callback<any>): void;
2110 df(): Promise<any>;
2111
2112 version(callback: Callback<Dockerode.DockerVersion>): void;
2113 version(): Promise<Dockerode.DockerVersion>;
2114
2115 ping(callback: Callback<any>): void;
2116 ping(): Promise<any>;
2117
2118 getEvents(options: Dockerode.GetEventsOptions, callback: Callback<NodeJS.ReadableStream>): void;
2119 getEvents(callback: Callback<NodeJS.ReadableStream>): void;
2120 getEvents(options?: Dockerode.GetEventsOptions): Promise<NodeJS.ReadableStream>;
2121
2122 pull(repoTag: string, options: {}, callback: Callback<any>, auth?: {}): Dockerode.Image;
2123 pull(repoTag: string, options?: {}): Promise<any>;
2124
2125 run(
2126 image: string,
2127 cmd: string[],
2128 outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
2129 createOptions: Dockerode.ContainerCreateOptions,
2130 startOptions: Dockerode.ContainerStartOptions,
2131 callback: Callback<any>,
2132 ): events.EventEmitter;
2133 run(
2134 image: string,
2135 cmd: string[],
2136 outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
2137 createOptions: Dockerode.ContainerCreateOptions,
2138 callback: Callback<any>,
2139 ): events.EventEmitter;
2140 run(
2141 image: string,
2142 cmd: string[],
2143 outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
2144 callback: Callback<any>,
2145 ): events.EventEmitter;
2146 run(
2147 image: string,
2148 cmd: string[],
2149 outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
2150 createOptions?: Dockerode.ContainerCreateOptions,
2151 startOptions?: Dockerode.ContainerStartOptions,
2152 ): Promise<any>;
2153
2154 swarmInit(options: {}, callback: Callback<any>): void;
2155 swarmInit(options: {}): Promise<any>;
2156
2157 swarmJoin(options: {}, callback: Callback<any>): void;
2158 swarmJoin(options: {}): Promise<any>;
2159
2160 swarmLeave(options: {}, callback: Callback<any>): void;
2161 swarmLeave(options: {}): Promise<any>;
2162
2163 swarmUpdate(options: {}, callback: Callback<any>): void;
2164 swarmUpdate(options: {}): Promise<any>;
2165
2166 swarmInspect(callback: Callback<any>): void;
2167 swarmInspect(): Promise<any>;
2168
2169 modem: DockerModem;
2170}
2171
2172export = Dockerode;