Skip to content
v2.273.0

DockerServerOptions Struct ​

The Docker server configuration CodeBuild use to build your Docker image.

Example ​

ts
declare const vpc: ec2.Vpc;
declare const mySecurityGroup: ec2.SecurityGroup;
new pipelines.CodeBuildStep('Synth', {
  // ...standard ShellStep props...
  commands: [
    /* ... */
  ],
  env: {
    /* ... */
  },

  // If you are using a CodeBuildStep explicitly, set the 'cdk.out' directory
  // to be the synth step's output.
  primaryOutputDirectory: 'cdk.out',

  // Control the name of the project
  projectName: 'MyProject',

  // Control parts of the BuildSpec other than the regular 'build' and 'install' commands
  partialBuildSpec: codebuild.BuildSpec.fromObject({
    version: '0.2',
    // ...
  }),

  // Control the build environment
  buildEnvironment: {
    computeType: codebuild.ComputeType.LARGE,
    privileged: true,
    dockerServer: {
      computeType: codebuild.DockerServerComputeType.SMALL,
      securityGroups: [mySecurityGroup],
    },
  },
  timeout: Duration.minutes(90),
  fileSystemLocations: [
    codebuild.FileSystemLocation.efs({
      identifier: 'myidentifier2',
      location: 'myclodation.mydnsroot.com:/loc',
      mountPoint: '/media',
      mountOptions: 'opts',
    }),
  ],

  // Control Elastic Network Interface creation
  vpc: vpc,
  subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
  securityGroups: [mySecurityGroup],

  // Control caching
  cache: codebuild.Cache.bucket(new s3.Bucket(this, 'Cache')),

  // Additional policy statements for the execution role
  rolePolicyStatements: [
    new iam.PolicyStatement({
      /* ... */
    }),
  ],
});

Properties ​

The type of compute to use for the docker server.

See the DockerServerComputeType enum for the possible values.

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= no security group#
A list of maximum 5 security groups.