if(string.IsNullOrEmpty(dockerUsername))thrownewException("Docker username required. (Pass to constructor or set 'DOCKERUSERNAME' environment variable.)");
if(string.IsNullOrEmpty(repoPath))thrownewException("Codex repo path required. (Pass to constructor or set 'CODEXREPOPATH' environment variable.)");
if(!Directory.Exists(repoPath))thrownewException($"Path '{repoPath}' does not exist.");
varfiles=Directory.GetFiles(repoPath);
if(!files.Any(f=>f.ToLowerInvariant().EndsWith("codex.nim")))thrownewException($"Path '{repoPath}' does not appear to be the Codex repo root.");
Log($"Codex docker image will be built in path '{repoPath}'.");
Log("Please note this can take several minutes. If you're not trying to use a Codex image with local code changes,");
Log("Consider using the default test image or consider setting the 'CODEXDOCKERIMAGE' environment variable to use an already built image.");
CodexContainerRecipe.DockerImageOverride=$"Using docker image locally built in path '{repoPath}'.";
}
publicvoidBuild()
{
if(!IsEnabled())return;
Log("Docker login...");
DockerLogin();
Log($"Logged in. Building Codex image in path '{repoPath}'...");