Dockerfile Requirements
The Dockerfile can be found in the main directory of your operator project. For Certified Operator Images Dockerfile requirements are as follows:
  1. 1.
    You must configure the required labels (name, maintainer, vendor, version, release, summary)
  2. 2.
    Software license(s) must be included within the image.
Although typically labels and licenses are not required to successfully build a running image, they are required for the Red Hat build service and scanner.
Below is an example Dockerfile for a Helm Operator which includes the aforementioned requirements:
Dockerfile
1
# Build the manager binary
2
FROM registry.redhat.io/openshift4/ose-helm-operator:v4.7
3
4
### Required OpenShift Labels
5
LABEL name="Wordpress Operator" \
6
vendor="Bitnami" \
7
version="v0.0.1" \
8
release="1" \
9
summary="This is an example of a wordpress helm operator." \
10
description="This operator will deploy wordpress to the cluster."
11
12
# Required Licenses
13
COPY licenses /licenses
14
15
ENV HOME=/opt/helm
16
COPY watches.yaml ${HOME}/watches.yaml
17
COPY helm-charts ${HOME}/helm-charts
18
WORKDIR ${HOME}
19
Copied!
A few things to note about the Dockerfile above:
  • The default FROM line produced by the SDK needs to be replaced with the line listed above.
  • This Dockerfile contains all of the required labels. These labels must be manually added (name, vendor, version, release, summary, and description).
  • This Dockerfile also references a licenses/ directory, which needs to be manually added to the root of the project. This directory must include the software license(s) of your project.
Your project directory structure should look similar to the hierarchy below. Note the location of the licenses directory.
wordpress-operator
1
.
2
├── charts
3
│   └── mariadb
4
│   ├── Chart.yaml
5
│   ├── files
6
│   │   └── docker-entrypoint-initdb.d
7
│   │   └── README.md
8
│   ├── OWNERS
9
│   ├── README.md
10
│   ├── templates
11
│   │   ├── _helpers.tpl
12
│   │   ├── initialization-configmap.yaml
13
│   │   ├── master-configmap.yaml
14
│   │   ├── master-pdb.yaml
15
│   │   ├── master-statefulset.yaml
16
│   │   ├── master-svc.yaml
17
│   │   ├── NOTES.txt
18
│   │   ├── rolebinding.yaml
19
│   │   ├── role.yaml
20
│   │   ├── secrets.yaml
21
│   │   ├── serviceaccount.yaml
22
│   │   ├── servicemonitor.yaml
23
│   │   ├── slave-configmap.yaml
24
│   │   ├── slave-pdb.yaml
25
│   │   ├── slave-statefulset.yaml
26
│   │   ├── slave-svc.yaml
27
│   │   ├── test-runner.yaml
28
│   │   └── tests.yaml
29
│   ├── values-production.yaml
30
│   ├── values.schema.json
31
│   └── values.yaml
32
├── Chart.yaml
33
├── config
34
│   ├── crd
35
│   │   ├── bases
36
│   │   │   └── example.com_wordpresses.yaml
37
│   │   └── kustomization.yaml
38
│   ├── default
39
│   │   ├── kustomization.yaml
40
│   │   └── manager_auth_proxy_patch.yaml
41
│   ├── manager
42
│   │   ├── kustomization.yaml
43
│   │   └── manager.yaml
44
│   ├── prometheus
45
│   │   ├── kustomization.yaml
46
│   │   └── monitor.yaml
47
│   ├── rbac
48
│   │   ├── auth_proxy_client_clusterrole.yaml
49
│   │   ├── auth_proxy_role_binding.yaml
50
│   │   ├── auth_proxy_role.yaml
51
│   │   ├── auth_proxy_service.yaml
52
│   │   ├── kustomization.yaml
53
│   │   ├── leader_election_role_binding.yaml
54
│   │   ├── leader_election_role.yaml
55
│   │   ├── role_binding.yaml
56
│   │   ├── role.yaml
57
│   │   ├── wordpress_editor_role.yaml
58
│   │   └── wordpress_viewer_role.yaml
59
│   ├── samples
60
│   │   ├── example_v1alpha1_wordpress.yaml
61
│   │   └── kustomization.yaml
62
│   └── scorecard
63
│   ├── bases
64
│   │   └── config.yaml
65
│   ├── kustomization.yaml
66
│   └── patches
67
│   ├── basic.config.yaml
68
│   └── olm.config.yaml
69
├── Dockerfile
70
├── helm-charts
71
│   └── wordpress
72
│   ├── charts
73
│   ├── Chart.yaml
74
│   ├── templates
75
│   │   ├── deployment.yaml
76
│   │   ├── _helpers.tpl
77
│   │   ├── hpa.yaml
78
│   │   ├── ingress.yaml
79
│   │   ├── NOTES.txt
80
│   │   ├── serviceaccount.yaml
81
│   │   ├── service.yaml
82
│   │   └── tests
83
│   │   └── test-connection.yaml
84
│   └── values.yaml
85
├── licenses
86
│   └── license.txt
87
├── Makefile
88
├── PROJECT
89
├── README.md
90
├── requirements.lock
91
├── requirements.yaml
92
├── templates
93
│   ├── deployment.yaml
94
│   ├── externaldb-secrets.yaml
95
│   ├── _helpers.tpl
96
│   ├── ingress.yaml
97
│   ├── NOTES.txt
98
│   ├── pvc.yaml
99
│   ├── secrets.yaml
100
│   ├── servicemonitor.yaml
101
│   ├── svc.yaml
102
│   ├── tests
103
│   │   └── test-mariadb-connection.yaml
104
│   └── tls-secrets.yaml
105
├── values.schema.json
106
├── values.yaml
107
└── watches.yaml
Copied!
Copy link