implement .createContainer()
This commit is contained in:
parent
c356042075
commit
4da7f5194a
4
dist/dockersock.classes.dockersock.d.ts
vendored
4
dist/dockersock.classes.dockersock.d.ts
vendored
@ -10,13 +10,13 @@ export declare class Dockersock {
|
||||
listImages(): any;
|
||||
listImagesDangling(): any;
|
||||
pullImage(imageLabel: string): any;
|
||||
createContainer(imageNameArg: any, pullFirst?: boolean): any;
|
||||
createContainer(optionsArg: any, pullFirstArg?: boolean): any;
|
||||
getContainerId(): void;
|
||||
startContainer(containerNameArg: any): any;
|
||||
stopContainer(containerNameArg: any): any;
|
||||
removeContainer(containerNameArg: any): any;
|
||||
clean(): any;
|
||||
getChange(): void;
|
||||
callOnChange(cb: Function): void;
|
||||
request(methodArg: string, routeArg: string, queryArg?: string, dataArg?: {}): any;
|
||||
requestStream(methodArg: any, routeArg: any, endArg?: boolean): any;
|
||||
}
|
||||
|
53
dist/dockersock.classes.dockersock.js
vendored
53
dist/dockersock.classes.dockersock.js
vendored
File diff suppressed because one or more lines are too long
@ -59,10 +59,20 @@ export class Dockersock {
|
||||
pullImage(imageLabel:string){
|
||||
return this.requestStream("POST","/images/create?fromImage=" + imageLabel);
|
||||
};
|
||||
createContainer(imageNameArg,pullFirst:boolean = true){
|
||||
return this.request("POST","/containers/create","",{
|
||||
"image":imageNameArg
|
||||
});
|
||||
createContainer(optionsArg,pullFirstArg:boolean = true){
|
||||
let done = plugins.q.defer();
|
||||
let create = () => {
|
||||
return this.request("POST","/containers/create","",optionsArg);
|
||||
}
|
||||
if(pullFirstArg){
|
||||
this.pullImage(optionsArg.Image)
|
||||
.then(create)
|
||||
.then(done.resolve);
|
||||
} else {
|
||||
create()
|
||||
.then(done.resolve)
|
||||
}
|
||||
return done.promise;
|
||||
};
|
||||
getContainerId(){
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user