build method

Future<DockerImage> build()

Builds the Docker image and returns this.

Sends the contents of path as a tar archive to the Docker daemon's POST /build endpoint. The resulting image ID is stored in shortId.

Throws HttpException if the build fails (non-2xx response from the Docker daemon).

Implementation

Future<DockerImage> build() async {
  final (imageId, logs) = await _dockerClient.buildImage(
    path,
    tag: tag,
    noCache: noCache,
    dockerfile: dockerfilePath,
  );
  _imageId = imageId;
  _logs = List.unmodifiable(logs);
  return this;
}