Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public bind(scope: cdk.Construct, containerDefinition: ContainerDefinition): ContainerImageConfig {
const asset = new DockerImageAsset(scope, 'AssetImage', {
directory: this.directory,
buildArgs: this.props.buildArgs,
target: this.props.target,
});
asset.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole());
return {
imageName: asset.imageUri,
};
}
}
public static fromAsset(scope: Construct, id: string, props: DockerImageAssetProps): IBuildImage {
const asset = new DockerImageAsset(scope, id, props);
return new WindowsBuildImage({
imageId: asset.imageUri,
imagePullPrincipalType: ImagePullPrincipalType.SERVICE_ROLE,
repository: asset.repository,
});
}