public String getSourceImageName(ServiceSpec serviceSpec, BuildContext buildContext) throws HyscaleException {

        if (BooleanUtils.toBoolean(buildContext.isStackAsServiceImage())) {
            return serviceSpec.get(HyscaleSpecFields.getPath(HyscaleSpecFields.image, HyscaleSpecFields.buildSpec,
                    HyscaleSpecFields.stackImage), String.class);
        }
        DockerImage dockerImage = buildContext.getDockerImage();

        return StringUtils.isNotBlank(dockerImage.getTag())
                ? dockerImage.getName() + ToolConstants.COLON + dockerImage.getTag()
                : dockerImage.getName();
    }
Source image is either the stack image being used as service image or
Local image build through dockerfile

@param serviceSpec
@param buildContext
@return source image name
@throws HyscaleException
image-builder/builder-services/src/main/java/io/hyscale/builder/services/impl/LocalImageBuildPushServiceImpl.java