# DockerBuildArg Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [DockerBuildArg](/reference/api/csharp/aspire.hosting/dockerbuildarg.md)
- Kind: `Constructors`
- Members: `1`

Represents a name/value pair, used to satisfy the `docker builder --build-arg <NAME>[=<VALUE>]` command switch. For more information, see [https://docs.docker.com/reference/cli/docker/image/build/#build-arg](https://docs.docker.com/reference/cli/docker/image/build/#build-arg).

## DockerBuildArg(string, object?)

- Name: `Constructor(string, object?)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerBuildArg.cs#L13-L23)

Represents a name/value pair, used to satisfy the `docker builder --build-arg <NAME>[=<VALUE>]` command switch. For more information, see [https://docs.docker.com/reference/cli/docker/image/build/#build-arg](https://docs.docker.com/reference/cli/docker/image/build/#build-arg).

```csharp
public sealed class DockerBuildArg
{
    public DockerBuildArg(
        string name,
        object? value = null)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The required name of the arg.
- `value` (`object?`) `optional`
  The optional value of the arg, when omitted the value is populated from the corresponding environment variable.
