# DockerBuildSecret

Methods to build Docker CLI arguments for builds using secrets.

Docker BuildKit must be enabled to use build secrets.

- Source: [`core/lib/bundling.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/bundling.ts#L19)
- Type last changed: v2.65.0 · 15 Feb 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const dockerBuildSecret = new cdk.DockerBuildSecret();
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

docker_build_secret = cdk.DockerBuildSecret()
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

DockerBuildSecret dockerBuildSecret = new DockerBuildSecret();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var dockerBuildSecret = new DockerBuildSecret();
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

dockerBuildSecret := cdk.NewDockerBuildSecret()
```

## Initializer

TypeScript:

```ts
new DockerBuildSecret()
```

Python:

```python
DockerBuildSecret()
```

Java:

```java
new DockerBuildSecret()
```

C# / .NET:

```csharp
new DockerBuildSecret()
```

Golang:

```go
NewDockerBuildSecret()
```

## Methods

- `fromSrc(src: string): string` (static) — A Docker build secret from a file source.

  **Parameters**

  - `src` — The path to the source file, relative to the build directory.

  **Returns:** The latter half required for `--secret`
