Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow docker driver to run in privileged mode #199

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions driver/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (d *Driver) AddConfigurationOptions(opts ...ConfigurationOption) {
func (d *Driver) Config() map[string]string {
return map[string]string{
"VERBOSE": "Increase verbosity. true, false are supported values",
"PRIVILEGED": "Give extended privileges to container (allow docker-in-docker)",
"PULL_ALWAYS": "Always pull image, even if locally available (0|1)",
"DOCKER_DRIVER_QUIET": "Make the Docker driver quiet (only print container stdout/stderr)",
"OUTPUTS_MOUNT_PATH": "Absolute path to where Docker driver can create temporary directories to bundle outputs. Defaults to temp dir.",
Expand Down Expand Up @@ -164,6 +165,9 @@ func (d *Driver) exec(op *driver.Operation) (driver.OperationResult, error) {
}

hostCfg := &container.HostConfig{}
if d.config["PRIVILEGED"] == "1" {
hostCfg.Privileged = true
}
for _, opt := range d.dockerConfigurationOptions {
if err := opt(cfg, hostCfg); err != nil {
return driver.OperationResult{}, err
Expand Down