-
-
Notifications
You must be signed in to change notification settings - Fork 348
Expand file tree
/
Copy pathIImageFromDockerfileBuilder`1.cs
More file actions
81 lines (73 loc) · 3.15 KB
/
IImageFromDockerfileBuilder`1.cs
File metadata and controls
81 lines (73 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
namespace DotNet.Testcontainers.Builders
{
using System;
using Docker.DotNet.Models;
using DotNet.Testcontainers.Images;
using JetBrains.Annotations;
/// <summary>
/// A fluent Docker image builder.
/// </summary>
/// <typeparam name="TBuilderEntity">The builder entity.</typeparam>
[PublicAPI]
public interface IImageFromDockerfileBuilder<out TBuilderEntity>
{
/// <summary>
/// Sets the name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithName(string name);
/// <summary>
/// Sets the name.
/// </summary>
/// <param name="image">The image.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithName(IImage image);
/// <summary>
/// Sets the Dockerfile.
/// </summary>
/// <param name="dockerfile">An absolute path or a name value within the Docker build context.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithDockerfile(string dockerfile);
/// <summary>
/// Sets the Dockerfile directory.
/// </summary>
/// <param name="dockerfileDirectory">An absolute path or a name value to the Docker build context.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithDockerfileDirectory(string dockerfileDirectory);
/// <summary>
/// Sets the Dockerfile directory.
/// </summary>
/// <param name="commonDirectoryPath">A common directory path that contains the Dockerfile directory.</param>
/// <param name="dockerfileDirectory">A relative path or a name value to the Docker build context.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithDockerfileDirectory(CommonDirectoryPath commonDirectoryPath, string dockerfileDirectory);
/// <summary>
/// Sets the image build policy.
/// </summary>
/// <param name="imageBuildPolicy">The image build policy.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithImageBuildPolicy(Func<ImageInspectResponse, bool> imageBuildPolicy);
/// <summary>
/// Removes an existing image before building it again.
/// </summary>
/// <param name="deleteIfExists">Determines whether Testcontainers removes an existing image or not.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithDeleteIfExists(bool deleteIfExists);
/// <summary>
/// Sets the build argument.
/// </summary>
/// <param name="name">The build argument name.</param>
/// <param name="value">The build argument value.</param>
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
[PublicAPI]
TBuilderEntity WithBuildArgument(string name, string value);
}
}