UNPKG

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