diff --git a/src/constants.ts b/src/constants.ts index 9740cfc9..24305b66 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -144,3 +144,6 @@ export const ACCOUNT_CREATION_FINISHED = `${CHECK_SUCCESS} Accounts created succ export const RESOURCE_CREATION_STATE_INIT_MESSAGE = `${CHECK_SUCCESS} Resource Creation State Initialized!`; export const RESOURCE_CREATION_STARTING_SYNCHRONOUS_MESSAGE = `${LOADING} Starting Resource Creation state in synchronous mode...`; export const RESOURCE_CREATION_STARTING_ASYNCHRONOUS_MESSAGE = `${LOADING} Starting Resource Creation state in asynchronous mode...`; + +// Docker messages +export const SHARED_PATHS_ERROR = `You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.`; diff --git a/src/services/DockerService.ts b/src/services/DockerService.ts index 45241761..605a9baa 100644 --- a/src/services/DockerService.ts +++ b/src/services/DockerService.ts @@ -22,12 +22,12 @@ import Dockerode from 'dockerode'; import shell from 'shelljs'; import semver from'semver'; import fs from 'fs'; -import { IS_WINDOWS, NECESSARY_PORTS, UNKNOWN_VERSION, OPTIONAL_PORTS, - MIN_CPUS, MIN_MEMORY_MULTI_MODE, MIN_MEMORY_SINGLE_MODE, - RECOMMENDED_CPUS, RECOMMENDED_MEMORY_SINGLE_MODE, - CHECK_SUCCESS, - CHECK_FAIL, - LOADING} from '../constants'; +import { + IS_WINDOWS, NECESSARY_PORTS, UNKNOWN_VERSION, OPTIONAL_PORTS, MIN_CPUS, + MIN_MEMORY_MULTI_MODE, MIN_MEMORY_SINGLE_MODE, RECOMMENDED_CPUS, + RECOMMENDED_MEMORY_SINGLE_MODE, CHECK_SUCCESS, CHECK_FAIL, LOADING, + SHARED_PATHS_ERROR +} from '../constants'; import { IService } from './IService'; import { LoggerService } from './LoggerService'; import { ServiceLocator } from './ServiceLocator'; @@ -260,6 +260,12 @@ export class DockerService implements IService{ private logShellOutput(shellExec: any) { [shellExec.stdout, shellExec.stderr].forEach( (output: string) => { output.split("\n").map((line: string) => { + if (line.indexOf(SHARED_PATHS_ERROR) > -1) { + this.logger.error(`Hedera local node start up TERMINATED due to docker's misconfiguration`); + this.logger.error(SHARED_PATHS_ERROR); + this.logger.error(`See https://docs.docker.com/desktop/settings/mac/#file-sharing for more info.`); + process.exit(); + } if (line === "") return; this.logger.debug(line, this.serviceName); });