🤖 Merge PR #45209 Add NetworkCreateOptions and type createNetwork by @stuartthomson

This commit is contained in:
Stuart 2020-06-01 14:12:38 +01:00 committed by GitHub
parent 68499eec45
commit a4769c3dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 2 deletions

View File

@ -137,6 +137,18 @@ docker.createContainer({ Tty: true }, (err, container) => {
});
});
docker.createNetwork({Name: 'networkName'}, (err, network) => {
network.remove((err, data) => {
// NOOP
});
});
docker.createNetwork({Name: 'networkName'}).then((network) => {
network.remove().then((response) => {
// NOOP
});
});
docker.pruneContainers((err, response) => {
// NOOP
});

View File

@ -407,6 +407,19 @@ declare namespace Dockerode {
Labels?: { [key: string]: string };
}
interface NetworkCreateOptions {
Name: string;
CheckDuplicate?: boolean;
Driver?: string;
Internal?: boolean;
Attachable?: boolean;
Ingress?: boolean;
IPAM?: IPAM;
EnableIPv6?: boolean;
Options?: { [option: string]: string};
Labels?: { [label: string]: string};
}
interface NetworkContainer {
Name: string;
EndpointID: string;
@ -1301,8 +1314,8 @@ declare class Dockerode {
createService(options: {}, callback: Callback<any>): void;
createService(options: {}): Promise<any>;
createNetwork(options: {}, callback: Callback<any>): void;
createNetwork(options: {}): Promise<any>;
createNetwork(options: {}, callback: Callback<Dockerode.Network>): void;
createNetwork(options: {}): Promise<Dockerode.Network>;
searchImages(options: {}, callback: Callback<any>): void;
searchImages(options: {}): Promise<any>;