Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Commit f79f570

Browse files
Stretch96squidfunk
authored andcommitted
Added support for privileged mode
* (Feature) Support CodeBuild Privileged Mode * Privileged mode enables running the Docker daemon inside a Docker container. * (Chore) Add `codebuild_privileged_mode` usage to readme
1 parent 040ec04 commit f79f570

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ The following variables can be configured:
140140
- **Default**: `"buildspec.yml"` (at repository root)
141141
- **Conflicts with**: `codebuild_project`
142142

143+
### `codebuild_privileged_mode`
144+
145+
- **Description**: If set to true, enables running the Docker daemon inside a Docker container.
146+
- **Default**: false
147+
- **Conflicts with**: `codebuild_project`
148+
143149
#### `codebuild_bucket`
144150

145151
- **Description**: S3 bucket to store status badge and artifacts

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ resource "aws_codebuild_project" "_" {
132132
}
133133

134134
environment {
135-
compute_type = "${var.codebuild_compute_type}"
136-
type = "LINUX_CONTAINER"
137-
image = "${var.codebuild_image}"
135+
compute_type = "${var.codebuild_compute_type}"
136+
type = "LINUX_CONTAINER"
137+
image = "${var.codebuild_image}"
138+
privileged_mode = "${var.codebuild_privileged_mode}"
138139
}
139140

140141
artifacts {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ variable "codebuild_buildspec" {
8080
default = ""
8181
}
8282

83+
# var.codebuild_privileged_mode
84+
variable "codebuild_privileged_mode" {
85+
description = "Enables running the Docker daemon inside a Docker container"
86+
default = "false"
87+
}
88+
8389
# var.codebuild_bucket
8490
variable "codebuild_bucket" {
8591
description = "S3 bucket to store status badge and artifacts"

0 commit comments

Comments
 (0)