Skip to content

Commit d86e4a8

Browse files
authored
Merge pull request #83 from magec/feature/allow_privileged
Allow running privileged containers
2 parents 9e766ab + 1c28bcc commit d86e4a8

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ Whether or not to automatically propagate all pipeline environment variables int
163163

164164
Note that only pipeline variables will automatically be propagated (what you see in the Buildkite UI). Variables set in proceeding hook scripts will not be propagated to the container.
165165

166+
### `privileged` (optional, boolean)
167+
168+
Whether or not to run the container in [privileged mode](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)
169+
166170
### `mount-buildkite-agent` (optional, boolean)
167171

168172
Whether to automatically mount the `buildkite-agent` binary from the host agent machine into the container. Set to `false` if you want to disable, or if you already have your own binary in the image.

hooks/command

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ while IFS='=' read -r name _ ; do
158158
fi
159159
done < <(env | sort)
160160

161+
# Privileged container
162+
if [[ "${BUILDKITE_PLUGIN_DOCKER_PRIVILEGED:-false}" =~ ^(true|on|1)$ ]] ; then
163+
args+=( "--privileged" )
164+
fi
165+
161166
# Propagate all environment variables into the container if requested
162167
if [[ "${BUILDKITE_PLUGIN_DOCKER_PROPAGATE_ENVIRONMENT:-false}" =~ ^(true|on|1)$ ]] ; then
163168
if [[ -n "${BUILDKITE_ENV_FILE:-}" ]] ; then

plugin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ configuration:
3737
type: string
3838
propagate-environment:
3939
type: boolean
40+
privileged:
41+
type: boolean
4042
required:
4143
- image
4244
additionalProperties: false

0 commit comments

Comments
 (0)