You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the `uid-range` and `supplemental-groups`. In this case, the project `coder`
171
+
has been allocated 10,000 UIDs starting at 1000680000, and 10,000 GIDs starting
172
+
at 1000680000. In this example, we will pick UID and GID 1000680000.
173
+
174
+
1. Create a `BuildConfig` referencing the source image you want to customize.
175
+
This will automatically kick off a `Build` that will remain pending until step 3.
176
+
177
+
> For more information, please consult the [OpenShift Documentation](https://docs.openshift.com/container-platform/4.12/cicd/builds/understanding-buildconfigs.html).
178
+
179
+
```console
180
+
oc create -f - <<EOF
181
+
kind: BuildConfig
182
+
apiVersion: build.openshift.io/v1
183
+
metadata:
184
+
name: enterprise-base
185
+
namespace: coder
186
+
spec:
187
+
output:
188
+
to:
189
+
kind: ImageStreamTag
190
+
name: 'enterprise-base:latest'
191
+
strategy:
192
+
type: Docker
193
+
dockerStrategy:
194
+
imageOptimizationPolicy: SkipLayers
195
+
source:
196
+
type: Dockerfile
197
+
dockerfile: |
198
+
# Specify the source image.
199
+
FROM docker.io/codercom/enterprise-base:ubuntu
200
+
201
+
# Switch to root
202
+
USER root
203
+
204
+
# As root:
205
+
# 1) Remove the original coder user with UID 1000
206
+
# 2) Add a coder group with an allowed UID
207
+
# 3) Add a coder user as a member of the above group
208
+
# 4) Fix ownership on the user's home directory
209
+
RUN userdel coder && \
210
+
groupadd coder -g 1000680000 && \
211
+
useradd -l -u 1000680000 coder -g 1000680000 && \
212
+
chown -R coder:coder /home/coder
213
+
214
+
# Go back to the user 'coder'
215
+
USER coder
216
+
triggers:
217
+
- type: ConfigChange
218
+
runPolicy: Serial
219
+
EOF
220
+
```
221
+
222
+
223
+
1. Create an `ImageStream` as a target for the previous step:
224
+
225
+
```console
226
+
oc create imagestream enterprise-base
227
+
```
228
+
229
+
The `Build` created in the previous step should now begin.
230
+
Once completed, you should see output similar to the following:
231
+
232
+
```console
233
+
oc get imagestreamtag
234
+
NAME IMAGE REFERENCE UPDATED
235
+
enterprise-base:latest image-registry.openshift-image-registry.svc:5000/coder/enterprise-base@sha256:1dbbe4ee11be9218e1e4741264135a4f57501fe592d94d20db6bfe11692accd1 55 minutes ago
0 commit comments