Skip to content

Commit debb021

Browse files
committed
Modify to run in Restricted SCC
(cherry picked from commit 71be71f3a020e1d8f006a834598f470bd977b000)
1 parent b38e992 commit debb021

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

openshift-app-sample/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
ENV APP_HOME /go/src/openshift-app-sample
3131
RUN groupadd $APP_USER && useradd -m -g $APP_USER -l $APP_USER
3232
RUN mkdir -p $APP_HOME
33+
# Create the directories the client expects to be present
34+
RUN mkdir -p /IBM/MQ/data/errors \
35+
&& mkdir -p /.mqm \
36+
&& chmod -R 777 /IBM \
37+
&& chmod -R 777 /.mqm
3338
WORKDIR $APP_HOME
3439
COPY --chown=0:0 --from=builder $APP_HOME/openshift-app-sample $APP_HOME
3540
COPY --chown=0:0 --from=builder /opt/mqm /opt/mqm

openshift-app-sample/yaml/pod-sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
containers:
77
- name: golang-app
8-
image: uk.icr.io/golang-sample/golang-app:1.0
8+
image: uk.icr.io/golang-sample/golang-app:1.2
99
restartPolicy: OnFailure
1010
imagePullSecrets:
1111
- name: all-icr-io
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: my-service-account
5+
---
6+
kind: Role
7+
apiVersion: rbac.authorization.k8s.io/v1
8+
metadata:
9+
name: pod-interactions
10+
rules:
11+
- apiGroups: [""]
12+
resources: ["pods", "pods/exec"]
13+
verbs: ["get", "list", "delete", "patch", "create"]
14+
---
15+
apiVersion: rbac.authorization.k8s.io/v1
16+
kind: RoleBinding
17+
metadata:
18+
name: pod-interactions
19+
subjects:
20+
- kind: User
21+
name: my-service-account
22+
roleRef:
23+
kind: Role
24+
name: pod-interactions
25+
apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)