Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
f772ca15ef | |||
71cfad146f | |||
43b1c13256 | |||
2c8b17f029 | |||
c6521d9160 | |||
72c74e44b5 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/docker",
|
"name": "@mojoio/docker",
|
||||||
"version": "1.0.38",
|
"version": "1.0.41",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/docker",
|
"name": "@mojoio/docker",
|
||||||
"version": "1.0.38",
|
"version": "1.0.41",
|
||||||
"description": "easy communication with docker remote api from node, TypeScript ready",
|
"description": "easy communication with docker remote api from node, TypeScript ready",
|
||||||
"private": false,
|
"private": false,
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -1 +0,0 @@
|
|||||||
import * as plugins from './dockersock.plugins';
|
|
@ -13,6 +13,13 @@ export class DockerImage {
|
|||||||
return images;
|
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(
|
public static async createFromRegistry(
|
||||||
dockerHostArg: DockerHost,
|
dockerHostArg: DockerHost,
|
||||||
creationObject: interfaces.IImageCreationDescriptor
|
creationObject: interfaces.IImageCreationDescriptor
|
||||||
@ -28,7 +35,9 @@ export class DockerImage {
|
|||||||
'info',
|
'info',
|
||||||
`Successfully pulled image ${creationObject.imageUrl} from the registry`
|
`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;
|
return image;
|
||||||
} else {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log('error', `Failed at the attempt of creating a new image`);
|
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
|
* the tags for an image
|
||||||
*/
|
*/
|
||||||
public tags: string[];
|
|
||||||
public Containers: number;
|
public Containers: number;
|
||||||
public Created: number;
|
public Created: number;
|
||||||
public Id: string;
|
public Id: string;
|
||||||
@ -85,6 +93,10 @@ export class DockerImage {
|
|||||||
return this.RepoTags.length > 0;
|
return this.RepoTags.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public tagImage(newTag) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pulls the latest version from the registry
|
* pulls the latest version from the registry
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user