public static async Task <int> Run(ILauncher launcher, IRecorder recorder) { var cacheDir = await recorder.GetCacheDir(); var dockerfile = await recorder.LoadDockerfile(); string tempImageFile; await using (FileUtil.CreateTempFile(recorder.WorkspaceDir, out tempImageFile)) {} var props = new RunDockerBuild( buildContextDir: recorder.BuildContext, cacheDir: cacheDir, enableNetwork: recorder.EnableNetwork, dockerfile: dockerfile, proxyImage: "helium-build/container-build-proxy:debian-buster-20190708", outputFile: tempImageFile, buildArgs: recorder.BuildArgs ); return(await launcher.BuildContainer(recorder.Platform, props)); }
protected override void AddContainerBuildArguments(ProcessStartInfo psi, RunDockerBuild build) { psi.ArgumentList.Add("container-build"); psi.ArgumentList.Add(JsonConvert.SerializeObject(build)); }
public override Task <int> BuildContainer(PlatformInfo platform, RunDockerBuild props) { return(RunWebSocketExecutor(props, CancellationToken.None)); }
protected abstract void AddContainerBuildArguments(ProcessStartInfo psi, RunDockerBuild build);
public sealed override async Task <int> BuildContainer(PlatformInfo platform, RunDockerBuild props) { var psi = CreatePSI(); AddContainerBuildArguments(psi, props); var process = Process.Start(psi) ?? throw new Exception("Could not start docker process."); await process.WaitForExitAsync(); return(process.ExitCode); }
protected override void AddContainerBuildArguments(ProcessStartInfo psi, RunDockerBuild build) => throw new NotSupportedException();
public abstract Task <int> BuildContainer(PlatformInfo platform, RunDockerBuild props);