---
title: Exporters overview
linkTitle: Exporters
weight: 90
description: Build exporters define the output format of your build result
keywords: build, buildx, buildkit, exporter, image, registry, local, tar, oci, docker, cacheonly
aliases:
- /build/building/exporters/
---
Exporters save your build results to a specified output type. You specify the
exporter to use with the
[`--output` CLI option](/reference/cli/docker/buildx/build.md#output).
Buildx supports the following exporters:
- `image`: exports the build result to a container image.
- `registry`: exports the build result into a container image, and pushes it to
the specified registry.
- `local`: exports the build root filesystem into a local directory.
- `tar`: packs the build root filesystem into a local tarball.
- `oci`: exports the build result to the local filesystem in the
[OCI image layout](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-layout.md)
format.
- `docker`: exports the build result to the local filesystem in the
[Docker Image Specification v1.2.0](https://github.com/moby/moby/blob/v25.0.0/image/spec/v1.2.md)
format.
- `cacheonly`: doesn't export a build output, but runs the build and creates a
cache.
## Using exporters
To specify an exporter, use the following command syntax:
```console
$ docker buildx build --tag <registry>/<image> \
--output type=<TYPE> .
```
Most common use cases don't require that you specify which exporter to use
explicitly. You only need to specify the exporter if you intend to customize
the output, or if you want to save it to disk. The `--load` and `--push`
options allow Buildx to infer the exporter settings to use.
For example, if you use the `--push` option in combination with `--tag`, Buildx
automatically uses the `image` exporter, and configures the exporter to push the
results to the specified registry.
To get the full flexibility out of the various exporters BuildKit has to offer,
you use the `--output` flag that lets you configure exporter options.
## Use cases
Each exporter type is designed for different use cases. The following sections
describe some common scenarios, and how you can use exporters to generate the
output that you need.
### Load to image store
Buildx is often used to build container images that can be loaded to an image
store. That's where the `docker` exporter comes in. The following example shows
how to build an image using the `docker` exporter, and have that image loaded to
the local image store, using the `--output` option:
```console
$ docker buildx build \
--output type=docker,name=<registry>/<image> .
```
Buildx CLI will automatically use the `docker` exporter and load it to the image
store if you supply the `--tag` and `--load` options:
```console
$ docker buildx build --tag <registry>/<image> --load .
```
Building images using the `docker` driver are automatically loaded to the local
image store.
Images loaded to the image store are available to `docker run` immediately
after the build finishes, and you'll see them in the list of images when you run
the `docker images` command.
### Push to registry
To push a built image to a container registry, you can use the `registry` or
`image` exporters.
When you pass the `--push` option to the Buildx CLI, you instruct BuildKit to
push the built image to the specified registry:
```console
$ docker buildx build --tag <registry>/<image> --push .
```
Under the hood, this uses the `image` exporter, and sets the `push` parameter.
It's the same as using the following long-form command using the `--output`
option:
```console
$ docker buildx build \
--output type=image,name=<registry>/<image>,push=true .
```
You can also use the `registry` exporter, which does the same thing:
```console
$ docker buildx build \
--output type=registry,name=<registry>/<image> .
```
### Export image layout to file
You can use either the `oci` or `docker` exporters to save the build results to
image layout on your local filesystem. Both of these exporters generate a tar