Merge branch 'dev' into HEAD

This commit is contained in:
ajnart
2023-04-03 15:40:47 +09:00
7 changed files with 74 additions and 59 deletions

View File

@@ -9,7 +9,12 @@ export default class DockerSingleton extends Docker {
public static getInstance(): DockerSingleton {
if (!DockerSingleton.dockerInstance) {
DockerSingleton.dockerInstance = new DockerSingleton();
DockerSingleton.dockerInstance = new Docker({
// If env variable DOCKER_HOST is not set, it will use the default socket
...(process.env.DOCKER_HOST && { host: process.env.DOCKER_HOST }),
// Same thing for docker port
...(process.env.DOCKER_PORT && { port: process.env.DOCKER_PORT }),
});
}
return DockerSingleton.dockerInstance;
}