fix(core): update

This commit is contained in:
2024-06-05 23:56:02 +02:00
parent 224004217c
commit cbdbd32dd1
4 changed files with 15 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import { DockerNetwork } from './classes.network.js';
import { DockerService } from './classes.service.js';
import { logger } from './logging.js';
import path from 'path';
import type { DockerImageStore } from './classes.imagestore.js';
export interface IAuthData {
serveraddress: string;
@@ -11,21 +12,27 @@ export interface IAuthData {
password: string;
}
export interface IDockerHostConstructorOptions {
dockerSockPath?: string;
imageStoreDir?: string;
}
export class DockerHost {
/**
* the path where the docker sock can be found
*/
public socketPath: string;
private registryToken: string = '';
public imageStore: DockerImageStore;
/**
* the constructor to instantiate a new docker sock instance
* @param pathArg
*/
constructor(pathArg?: string) {
constructor(optionsArg: IDockerHostConstructorOptions) {
let pathToUse: string;
if (pathArg) {
pathToUse = pathArg;
if (optionsArg.dockerSockPath) {
pathToUse = optionsArg.dockerSockPath;
} else if (process.env.DOCKER_HOST) {
pathToUse = process.env.DOCKER_HOST;
} else if (process.env.CI) {