## docker (platform)

Deploy a container to Docker, local or remote.

### Interface

- Input: **docker.Image**
- Output: **docker.Deployment**

### Examples

```hcl
deploy {
  use "docker" {
	command      = ["ps"]
	service_port = 3000
	static_environment = {
	  "environment": "production",
	  "LOG_LEVEL": "debug"
	}
  }
}
```

### Required Parameters

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

#### client_config

Client config for remote Docker engine.

This config block can be used to configure a remote Docker engine. By default Waypoint will attempt to discover this configuration using the environment variables: `DOCKER_HOST` to set the url to the docker server. `DOCKER_API_VERSION` to set the version of the API to reach, leave empty for latest. `DOCKER_CERT_PATH` to load the TLS certificates from. `DOCKER_TLS_VERIFY` to enable or disable TLS verification, off by default.

- Type: **docker.ClientConfig**

### 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**

#### binds

A 'source:destination' list of folders to mount onto the container from the host.

A list of folders to mount onto the container from the host. The expected format for each string entry in the list is `source:destination`. So for example: `binds: ["host_folder/scripts:/scripts"].

- Type: **list of string**
- **Optional**

#### command

The command to run to start the application in the container.

- Type: **list of string**
- **Optional**
- Default: the image entrypoint

#### extra_ports

Additional TCP ports the application is listening on to expose on the container.

Used to define and expose multiple ports that the application is listening on for the container in use. These ports will get merged with service_port when creating the container if defined.

- Type: **list of uint**
- **Optional**

#### force_pull

Always pull the docker container from the registry.

- Type: **bool**
- **Optional**
- Default: false

#### labels

A map of key/value pairs to label the docker container with.

A map of key/value pair(s), stored in docker as a string. Each key/value pair must be unique. Validiation occurs at the docker layer, not in Waypoint. Label keys are alphanumeric strings which may contain periods (.) and hyphens (-).

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

#### networks

An list of strings with network names to connect the container to.

A list of networks to connect the container to. By default the container will always connect to the `waypoint` network.

- Type: **list of string**
- **Optional**
- Default: waypoint

#### resources

A map of resources to configure the container with, such as memory or cpu limits.

These options are used to configure the container used when deploying with docker. Currently, the supported resources are 'memory' and 'cpu' limits. The field 'memory' is expected to be defined as "512MB", "44kB", etc.

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

#### scratch_path

A path within the container to store temporary data.

Docker will mount a tmpfs at this path.

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

#### service_port

Port that your service is running on in the container.

- Type: **uint**
- **Optional**
- Default: 3000

#### static_environment

Environment variables to expose to the application.

These environment variables should not be run of the mill configuration variables, use waypoint config for that. These variables are used to control over all container modes, such as configuring it to start a web app vs a background worker.

- Type: **map of string to 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).

#### container

- Type: **string**

#### id

- Type: **string**

#### name

- Type: **string**

#### resource_state

- Type: **opaqueany.Any**
