added code for privileged mode with unit tests

This commit is contained in:
Brad Rydzewski
2014-03-18 23:21:04 -07:00
parent f363ce804b
commit d7096f7e66
2 changed files with 72 additions and 7 deletions

View File

@@ -309,11 +309,10 @@ func (b *Builder) run() error {
AttachStderr: true,
}
// configure if Docker should run in privileged mode.
// by default, this is disabled for pull requests for
// security reasons.
host := docker.HostConfig{}
host.Privileged = b.Privileged && len(b.Repo.PR) == 0
// configure if Docker should run in privileged mode
host := docker.HostConfig{
Privileged: (b.Privileged && len(b.Repo.PR) == 0),
}
// debugging
log.Noticef("starting build %s", b.Build.Name)