Skip to content
v2.274.0

DockerBuildSecret Class ​

Methods to build Docker CLI arguments for builds using secrets.

Docker BuildKit must be enabled to use build secrets.

Example ​

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
# 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
// 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();
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();
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 ​

ts
new DockerBuildSecret()
python
DockerBuildSecret()
java
new DockerBuildSecret()
csharp
new DockerBuildSecret()
go
NewDockerBuildSecret()

Methods ​

fromSrc(src: string): string@staticmethod def from_src(src: str) -> strpublic static String fromSrc(String src)public static string FromSrc(string src)func FromSrc(Src *string) *stringstatic#
A Docker build secret from a file source.
1 parameter · returns

Parameters

  • srcsrcsrcsrcSrc — The path to the source file, relative to the build directory.

Returns: The latter half required for --secret