public async createRunnableAppImageFromDockerfile()

in src/ContainerAppHelper.ts [474:494]


    public async createRunnableAppImageFromDockerfile(
        imageToDeploy: string,
        appSourcePath: string,
        dockerfilePath: string,
        buildArguments: string[]) {
        toolHelper.writeDebug(`Attempting to create a runnable application image from the provided/found Dockerfile "${dockerfilePath}" with image name "${imageToDeploy}"`);
        try {
            let command = `docker build --file ${dockerfilePath} ${appSourcePath} --tag ${imageToDeploy}`;
            // If build arguments were provided, append them to the command
            if (buildArguments.length > 0) {
                buildArguments.forEach(function (buildArg: string) {
                    command += ` --build-arg ${buildArg}`;
                });
            }
            await util.execute(command);
            toolHelper.writeDebug(`Successfully created runnable application image from the provided/found Dockerfile "${dockerfilePath}" with image name "${imageToDeploy}"`);
        } catch (err) {
            toolHelper.writeError(err.message);
            throw err;
        }
    }