implement .createContainer()
This commit is contained in:
		
							
								
								
									
										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; |     listImages(): any; | ||||||
|     listImagesDangling(): any; |     listImagesDangling(): any; | ||||||
|     pullImage(imageLabel: string): any; |     pullImage(imageLabel: string): any; | ||||||
|     createContainer(imageNameArg: any, pullFirst?: boolean): any; |     createContainer(optionsArg: any, pullFirstArg?: boolean): any; | ||||||
|     getContainerId(): void; |     getContainerId(): void; | ||||||
|     startContainer(containerNameArg: any): any; |     startContainer(containerNameArg: any): any; | ||||||
|     stopContainer(containerNameArg: any): any; |     stopContainer(containerNameArg: any): any; | ||||||
|     removeContainer(containerNameArg: any): any; |     removeContainer(containerNameArg: any): any; | ||||||
|     clean(): any; |     clean(): any; | ||||||
|     getChange(): void; |     callOnChange(cb: Function): void; | ||||||
|     request(methodArg: string, routeArg: string, queryArg?: string, dataArg?: {}): any; |     request(methodArg: string, routeArg: string, queryArg?: string, dataArg?: {}): any; | ||||||
|     requestStream(methodArg: any, routeArg: any, endArg?: boolean): 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){ |     pullImage(imageLabel:string){ | ||||||
|         return this.requestStream("POST","/images/create?fromImage=" + imageLabel); |         return this.requestStream("POST","/images/create?fromImage=" + imageLabel); | ||||||
|     }; |     }; | ||||||
|     createContainer(imageNameArg,pullFirst:boolean = true){ |     createContainer(optionsArg,pullFirstArg:boolean = true){ | ||||||
|         return this.request("POST","/containers/create","",{ |         let done = plugins.q.defer(); | ||||||
|             "image":imageNameArg |         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(){ |     getContainerId(){ | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user