public static void DockerImageCreated(this ILogger logger, IDockerImage image) { _DockerImageCreated(logger, image.FullName, null); }
/// <inheritdoc /> public IImageFromDockerfileBuilder WithName(IDockerImage name) { return(new ImageFromDockerfileBuilder( new ImageFromDockerfileConfiguration(name, this.configuration.Dockerfile, this.configuration.DockerfileDirectory, this.configuration.DeleteIfExists))); }
/// <summary> /// Initializes a new instance of the <see cref="DockerImage" /> class. /// </summary> /// <param name="image">The Docker image.</param> public DockerImage(IDockerImage image) : this(image.Repository, image.Name, image.Tag) { }
public Task CreateAsync(IDockerImage image, CancellationToken ct = default) { return(this.Docker.Images.CreateImageAsync(new ImagesCreateParameters { FromImage = image.FullName }, null, DebugProgress.Provider, ct)); }
public Task DeleteAsync(IDockerImage image, CancellationToken ct = default) { return(this.Docker.Images.DeleteImageAsync(image.FullName, new ImageDeleteParameters { Force = true }, ct)); }
/// <summary> /// Initializes a new instance of the <see cref="DockerfileArchive" /> class. /// </summary> /// <param name="dockerfileDirectory">Directory to docker configuration files.</param> /// <param name="dockerfile">Name of the dockerfile, which is necessary to start the docker build.</param> /// <param name="image">Docker image information to create the tar archive for.</param> /// <param name="logger">The logger.</param> public DockerfileArchive(string dockerfileDirectory, string dockerfile, IDockerImage image, ILogger logger) : this(new DirectoryInfo(dockerfileDirectory), dockerfile, image, logger) { }
/// <summary> /// Initializes a new instance of the <see cref="DockerfileArchive" /> class. /// </summary> /// <param name="dockerfileDirectory">Directory to docker configuration files.</param> /// <param name="dockerfile">Name of the dockerfile, which is necessary to start the docker build.</param> /// <param name="image">Docker image information to create the tar archive for.</param> /// <param name="logger">The logger.</param> /// <exception cref="ArgumentException">Will be thrown if the dockerfile directory does not exist or the directory does not contain a dockerfile.</exception> public DockerfileArchive(DirectoryInfo dockerfileDirectory, string dockerfile, IDockerImage image, ILogger logger) { if (!dockerfileDirectory.Exists) { throw new ArgumentException($"Directory '{dockerfileDirectory.FullName}' does not exist."); } if (!dockerfileDirectory.GetFiles(dockerfile, SearchOption.TopDirectoryOnly).Any()) { throw new ArgumentException($"{dockerfile} does not exist in '{dockerfileDirectory.FullName}'."); } this.dockerfileDirectory = dockerfileDirectory; this.image = image; this.logger = logger; }
/// <inheritdoc /> public IImageFromDockerfileBuilder WithName(IDockerImage name) { return(this.MergeNewConfiguration(new ImageFromDockerfileConfiguration(image: name))); }
public IImageFromDockerfileBuilder WithName(IDockerImage name) { this.configuration.Image = name.Image; return(this); }
/// <inheritdoc cref="ITestcontainersBuilder{TDockerContainer}" /> public ITestcontainersBuilder <TDockerContainer> WithImage(IDockerImage image) { return(this.MergeNewConfiguration(new TestcontainersConfiguration(image: PrependHubImageNamePrefix(image)))); }
/// <inheritdoc /> public ITestcontainersBuilder <TDockerContainer> WithImage(IDockerImage image) { return(Build(this, Apply(image: image))); }
public ParseDockerImageFixtureSerializable(IDockerImage image) { this.Image = image; }