private boolean validate(ServiceSpec serviceSpec, BuildContext context) throws HyscaleException {
        String imageName = serviceSpec.get(HyscaleSpecFields.getPath(HyscaleSpecFields.image, HyscaleSpecFields.name),
                String.class);
        if (StringUtils.isBlank(imageName)) {
            throw new HyscaleException(ImageBuilderErrorCodes.CANNOT_RESOLVE_IMAGE_NAME);
        }
        String registryUrl = serviceSpec
                .get(HyscaleSpecFields.getPath(HyscaleSpecFields.image, HyscaleSpecFields.registry), String.class);
        if (registryUrl != null && context.getRegistriesMap().get(registryUrl) == null) {
            throw new HyscaleException(ImageBuilderErrorCodes.MISSING_DOCKER_REGISTRY_CREDENTIALS, registryUrl,
                    registryUrl);
        }
        return true;
    }
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