Skip to content

Commit 55286c8

Browse files
committed
feat(docker-registry-ui): add support to nginx user and custom container port
1 parent d40b59a commit 55286c8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

charts/docker-registry-ui/templates/ui-deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
{{- if and (not .Values.ui.runAsRoot) (lt (.Values.ui.service.targetPort | int) 1024) }}
2+
{{ fail "When `ui.runAsRoot` is false `ui.service.targetPort` must be less than 1024." }}
3+
{{- end }}
4+
15
apiVersion: apps/v1
26
kind: Deployment
37
metadata:
@@ -65,6 +69,8 @@ spec:
6569
value: {{ .Values.ui.catalogElementsLimit | quote }}
6670
- name: HISTORY_CUSTOM_LABELS
6771
value: {{ .Values.ui.historyCustomLabels | join "," }}
72+
- name: NGINX_LISTEN_PORT
73+
value: {{ .Values.ui.service.targetPort | quote }}
6874
ports:
6975
- name: http
7076
containerPort: {{ .Values.ui.service.targetPort }}
@@ -83,6 +89,10 @@ spec:
8389
tolerations:
8490
{{- toYaml . | nindent 8 | trim }}
8591
{{- end }}
92+
{{- if not .Values.ui.runAsRoot }}
93+
securityContext:
94+
runAsUser: 101
95+
{{- end }}
8696
{{- if .Values.ui.additionalSpec }}
8797
{{ tpl .Values.ui.additionalSpec . | nindent 6 | trim }}
8898
{{- end }}

charts/docker-registry-ui/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ ui:
3939
# Example:
4040
# nginxProxyPassHeaders: [ my-first-header, my-second-header ]
4141
nginxProxyPassHeaders: []
42+
# Use root or nginx user inside the container, when this is false the target port must be greater or equal to 1024.
43+
runAsRoot: true
4244
# The name and tag of the docker image of the interface
4345
image: joxit/docker-registry-ui:2.2.1
4446
# Override default image pull secrets

0 commit comments

Comments
 (0)