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

# docker_image

# `prefect.docker.docker_image`

## Classes

### `DockerImage` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker\_image.py#L32](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L32)</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>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker\_image.py#L100](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L100)</sup>

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

#### `push` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker\_image.py#L154](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L154)</sup>

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

#### `reference` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker\_image.py#L97](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/docker/docker_image.py#L97)</sup>

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