Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions cicd/builds/advanced-build-operations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ include::modules/builds-chaining-builds.adoc[leveloffset=+1]
include::modules/builds-build-pruning.adoc[leveloffset=+1]

include::modules/builds-build-run-policy.adoc[leveloffset=+1]

include::modules/builds-build-unprivileged.adoc[leveloffset=+1]
33 changes: 33 additions & 0 deletions modules/builds-build-unprivileged.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Module included in the following assemblies:
//
// * builds/advanced-build-operations.adoc

:_content-type: PROCEDURE
[id="builds-build-unprivileged_{context}"]
= Unprivileged Builds (Developer Preview)

Builds can be configured to run as an unprivileged user, with the minimal set of capabilities to build a container image.

[IMPORTANT]
====
[subs="attributes+"]
Unprivileged {product-title} Builds is a Developer Preview feature, intended to provide early access to new capabilities. This feature is not recommended for production or business-critical environments.
====

.Procedure

* To run builds as an unprivileged user, pass the `BUILD_PRIVILEGED` environment variable as part of the `sourceStrategy`
ifndef::openshift-online[]
or `dockerStrategy`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or customStrategy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I should add that too.

endif::[]
in a `BuildConfig`, with the value `"false"`:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or Build, unless that's assumed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build is typically assumed. OpenShift CI may be one of the few users that doesn't use BuildConfig objects.

+
[source,yaml]
----
sourceStrategy:
...
env:
- name: "BUILD_PRIVILEGED"
value: "false" <1>
----
<1> To run builds as an unprivileged user, set this value to `"false"` in quotation marks.