Provides functionality to build Docker images.
More...
Provides functionality to build Docker images.
◆ Builder()
Instantiates an instance of the Builder class.
- Parameters
-
client | A connection to the Docker daemon to use. |
◆ BuildAsync() [1/3]
async Task<IImage> DockerSdk.Builders.Builder.BuildAsync |
( |
IBundle |
bundle, |
|
|
BuildOptions |
options, |
|
|
CancellationToken |
ct = default |
|
) |
| |
|
inline |
Creates a new image from a Dockerfile.
- Parameters
-
bundle | A package of the Dockerfile with any other files that need to be available to the build process. |
options | Specifies how to create the image. |
ct | A token used to cancel the operation. |
- Returns
- A Task<Result> that resolves when the image has been built and is available locally.
- Exceptions
-
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as loss of network connectivity. |
DockerImageBuildException | The build failed. |
◆ BuildAsync() [2/3]
async Task<IImage> DockerSdk.Builders.Builder.BuildAsync |
( |
string |
contextPath, |
|
|
IEnumerable< string > |
filePaths, |
|
|
BuildOptions |
options, |
|
|
CancellationToken |
ct = default |
|
) |
| |
|
inline |
Creates a new image from a Dockerfile.
- Parameters
-
contextPath | The path to the folder containing the Dockerfile and that serves as the context root for files specified in filePaths . If this is a relative path, it's taken as relative to the process's current working path. |
filePaths | The paths to additional files to make available to the build process. These files must all be within the context path ( contextPath ). Any relative paths are taken as relative to the context path. |
options | Specifies how to create the image. |
ct | A token used to cancel the operation. |
- Returns
- A Task<Result> that resolves when the image has been built and is available locally.
- Exceptions
-
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as loss of network connectivity. |
ArgumentException | One or more of the files are not located within the context path. |
IOException | An I/O error occurred while trying to read one of the files. |
UnauthorizedAccessException | Either one of the files is a actually directory, or the process does not have permission to access one of the local files. |
NotSupportedException | One of the file paths is in an invalid format. |
DockerImageBuildException | The build failed. |
◆ BuildAsync() [3/3]
async Task<IImage> DockerSdk.Builders.Builder.BuildAsync |
( |
string |
contextPath, |
|
|
string |
dockerfilePath, |
|
|
IEnumerable< string > |
filePaths, |
|
|
BuildOptions |
options, |
|
|
CancellationToken |
ct = default |
|
) |
| |
|
inline |
Creates a new image from a Dockerfile.
- Parameters
-
contextPath | The path to the folder that serves as the context root for files specified in dockerfilePath and filePaths . If this is a relative path, it's taken as relative to the process's current working path. |
dockerfilePath | The path to the Dockerfile. This file must be within the context path ( contextPath ). If this is a relative path, it's taken as relative to the context path. |
filePaths | The paths to additional files to make available to the build process. These files must all be within the context path ( contextPath ). Any relative paths are taken as relative to the context path. |
options | Specifies how to create the image. |
ct | A token used to cancel the operation. |
- Returns
- A Task<Result> that resolves when the image has been built and is available locally.
- Exceptions
-
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as loss of network connectivity. |
ArgumentException | One or more of the files are not located within the context path. |
IOException | An I/O error occurred while trying to read one of the files. |
UnauthorizedAccessException | Either one of the files is a actually directory, or the process does not have permission to access one of the local files. |
NotSupportedException | One of the file paths is in an invalid format. |
DockerImageBuildException | The build failed. |
The documentation for this class was generated from the following file: