## docker (builder)

Build a Docker image from a Dockerfile.

If a Docker server is available (either locally or via environment variables
such as "DOCKER_HOST"), then "docker build" will be used to build an image
from a Dockerfile.

### Dockerless Builds

Many hosted environments, such as Kubernetes clusters, don't provide access
to a Docker server. In these cases, it is desirable to perform what is called
a "dockerless" build: building a Docker image without access to a Docker
daemon. Waypoint supports dockerless builds.

Waypoint performs Dockerless builds by leveraging
[Kaniko](https://github.com/GoogleContainerTools/kaniko)
within on-demand launched runners. This should work in all supported
Waypoint installation environments by default and you should not have
to specify any additional configuration.

### Interface

- Output: **docker.Image**

### Examples

```hcl
build {
  use "docker" {
	buildkit    = false
	disable_entrypoint = false
  }
}
```

### Required Parameters

This plugin has no required parameters.

### Optional Parameters

These parameters are used in the [`use` stanza](/docs/waypoint-hcl/use) for this plugin.

#### auth (category)

The authentication information to log into the docker repository.

##### auth.auth

- Type: **string**
- **Optional**

##### auth.email

- Type: **string**
- **Optional**

##### auth.hostname

Hostname of Docker registry.

- Type: **string**
- **Optional**

##### auth.identityToken

Token used to authenticate user.

- Type: **string**
- **Optional**

##### auth.password

Password of Docker registry account.

- Type: **string**
- **Optional**

##### auth.registryToken

Bearer tokens to be sent to Docker registry.

- Type: **string**
- **Optional**

##### auth.serverAddress

Address of Docker registry.

- Type: **string**
- **Optional**

##### auth.username

Username of Docker registry account.

- Type: **string**
- **Optional**

#### build_args

Build args to pass to docker for the build step.

An array of strings of build-time variables passed as build-arg to docker for the build step.

- Type: **map of string to string**
- **Optional**

#### buildkit

If set, use the buildkit builder from Docker.

- Type: **bool**
- **Optional**

#### context

Build context path.

- Type: **string**
- **Optional**

#### disable_entrypoint

If set, the entrypoint binary won't be injected into the image.

The entrypoint binary is what provides extended functionality such as logs and exec. If it is not injected at build time the expectation is that the image already contains it.

- Type: **bool**
- **Optional**

#### dockerfile

The path to the Dockerfile.

Set this when the Dockerfile is not APP-PATH/Dockerfile.

- Type: **string**
- **Optional**

#### no_cache

Do not use cache when building the image.

Ensures a clean image build.

- Type: **bool**
- **Optional**

#### platform

Set target platform to build container if server is multi-platform capable.

Must enable Docker buildkit to use the 'platform' flag.

- Type: **string**
- **Optional**

#### target

The target build stage in a multi-stage Dockerfile.

If buildkit is enabled unused stages will be skipped.

- Type: **string**
- **Optional**

### Output Attributes

Output attributes can be used in your `waypoint.hcl` as [variables](/docs/waypoint-hcl/variables) via [`artifact`](/docs/waypoint-hcl/variables/artifact) or [`deploy`](/docs/waypoint-hcl/variables/deploy).

#### architecture

- Type: **string**

#### image

- Type: **string**

#### location

- Type: **docker.isImage_Location**

#### tag

- Type: **string**
