> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# docker_image

# `prefect.docker.docker_image`

## Classes

### `DockerImage` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L32" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Configuration used to build and push a Docker image for a deployment.

**Attributes:**

* `name`: The name of the Docker image to build, including the registry and
  repository.
* `tag`: The tag to apply to the built image.
* `dockerfile`: The path to the Dockerfile to use for building the image. If
  not provided, a default Dockerfile will be generated.
* `stream_progress_to`: A stream to write build and push progress output to.
  Defaults to sys.stdout. Set to None to suppress output.
* `build_backend`: The backend to use for building images. `"docker-py"`
  (default) uses the docker-py library.  `"buildx"` uses
  python-on-whales for BuildKit/buildx support, enabling features
  like build secrets, SSH forwarding, and multi-platform builds.
* `**build_kwargs`: Additional keyword arguments to pass to the Docker build
  request.  When `build_backend="docker-py"`, these are forwarded to
  docker-py's `client.api.build()`.
  When `build_backend="buildx"`, these are forwarded to
  `python_on_whales.docker.buildx.build()` and may include
  `secrets`, `ssh`, `cache_from`, `cache_to`, `platforms`,
  and `push`.

**Methods:**

#### `build` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L100" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
build(self) -> None
```

#### `push` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L154" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
push(self) -> None
```

#### `reference` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L97" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
reference(self) -> str
```
