Compare commits

...

6 Commits

Author SHA1 Message Date
f772ca15ef 1.0.41 2019-08-15 19:04:10 +02:00
71cfad146f fix(core): update 2019-08-15 19:04:09 +02:00
43b1c13256 1.0.40 2019-08-15 19:02:44 +02:00
2c8b17f029 fix(core): update 2019-08-15 19:02:43 +02:00
c6521d9160 1.0.39 2019-08-15 19:00:17 +02:00
72c74e44b5 fix(core): update 2019-08-15 19:00:17 +02:00
4 changed files with 16 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/docker",
"version": "1.0.38",
"version": "1.0.41",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/docker",
"version": "1.0.38",
"version": "1.0.41",
"description": "easy communication with docker remote api from node, TypeScript ready",
"private": false,
"main": "dist/index.js",

View File

@ -1 +0,0 @@
import * as plugins from './dockersock.plugins';

View File

@ -13,6 +13,13 @@ export class DockerImage {
return images;
}
public static async findImageByName (dockerHost: DockerHost, imageNameArg: string) {
const images = await this.getImages(dockerHost);
return images.find(image => {
return image.RepoTags.includes(imageNameArg);
});
}
public static async createFromRegistry(
dockerHostArg: DockerHost,
creationObject: interfaces.IImageCreationDescriptor
@ -28,7 +35,9 @@ export class DockerImage {
'info',
`Successfully pulled image ${creationObject.imageUrl} from the registry`
);
const image = (await DockerImage.getImages(dockerHostArg)).find(image => true);
const originTag = `${creationObject.imageUrl}:${creationObject.tag}`;
console.log(originTag)
const image = await DockerImage.findImageByName(dockerHostArg, originTag);
return image;
} else {
plugins.smartlog.defaultLogger.log('error', `Failed at the attempt of creating a new image`);
@ -58,7 +67,6 @@ export class DockerImage {
/**
* the tags for an image
*/
public tags: string[];
public Containers: number;
public Created: number;
public Id: string;
@ -85,6 +93,10 @@ export class DockerImage {
return this.RepoTags.length > 0;
}
public tagImage(newTag) {
}
/**
* pulls the latest version from the registry
*/