Skip to content

Commit 102200c

Browse files
Merge pull request #1039 from Leo6Leo/leo/ocpbugs/60863/renamedockerfile
OCPBUGS-60863: Rename Dockerfile to Dockerfile.ocp
2 parents 76ae5da + 5d96b52 commit 102200c

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

Dockerfile.ocp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder
2+
ARG TAGS=ocp
3+
WORKDIR /go/src/github.com/openshift/console-operator
4+
COPY . .
5+
ENV GO_PACKAGE github.com/openshift/console-operator
6+
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="${TAGS}" -o console ./cmd/console
7+
8+
FROM registry.ci.openshift.org/ocp/4.20:base-rhel9
9+
RUN useradd console-operator
10+
USER console-operator
11+
COPY --from=builder /go/src/github.com/openshift/console-operator/console /usr/bin/console
12+
13+
# these manifests are necessary for the installer
14+
COPY manifests /manifests/
15+
16+
# out-of-the-box quickstarts
17+
COPY quickstarts/*.yaml /manifests/
18+
19+
# extensions manifests generated from openshift/api types
20+
COPY vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/*.crd.yaml /manifests/
21+
COPY vendor/github.com/openshift/api/operator/*/zz_generated.crd-manifests/*console*.crd.yaml /manifests/
22+
COPY vendor/github.com/openshift/api/helm/*/zz_generated.crd-manifests/*crd.yaml /manifests/
23+
24+
LABEL io.k8s.display-name="OpenShift console-operator" \
25+
io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of the web console." \
26+
io.openshift.tags="openshift" \
27+
maintainer="Jakub Hadvig <jhadvig@redhat.com>"
28+
29+
LABEL io.openshift.release.operator true
30+
31+
# entrypoint specified in 03-operator.yaml as `console-operator`
32+
# CMD ["/usr/bin/console", "operator", "--kubeconfig", "path/to/config", "--config", "./install/config.yaml", "--v", "4"]
33+
# CMD ["/usr/bin/console", "operator", "--v", "4"]

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ docker build -t <registry>/<your-username>/console-operator:<version> .
178178
# following: docker.io/openshift/origin-console-operator:latest
179179
# for development, you are going to push to an alternate registry.
180180
# specifically it can look something like this:
181-
docker build -f Dockerfile.rhel7 -t quay.io/benjaminapetersen/console-operator:latest .
181+
docker build -f Dockerfile.ocp -t quay.io/<your-username>/console-operator:latest .
182182
```
183183
You can optionally build a specific version.
184184

@@ -187,7 +187,7 @@ Then, push your image:
187187
```bash
188188
docker push <registry>/<your-username>/console-operator:<version>
189189
# Be sure your repository is public else the image will not be able to be pulled later
190-
docker push quay.io/benjaminapetersen/console-operator:latest
190+
docker push quay.io/<your-username>/console-operator:latest
191191
```
192192
Then, you will want to deploy your new container. This means duplicating the `manifests/07-operator.yaml`
193193
and updating the line `image: docker.io/openshift/origin-console-operator:latest` to instead use the
@@ -206,7 +206,7 @@ image: docker.io/openshift/origin-console-operator:latest
206206
# after
207207
# image: <registry>/<your-username>/console-operator:<version>
208208
replicas: 1
209-
image: quay.io/benjaminapetersen/console-operator:latest
209+
image: quay.io/<your-username>/console-operator:latest
210210
```
211211
And ensure that the `imagePullPolicy` is still `Always`. This will ensure a fast development feedback loop.
212212

@@ -229,9 +229,9 @@ Which looks like the following:
229229

230230
```bash
231231
# build binary + container
232-
docker build -t quay.io/benjaminapetersen/console-operator:latest .
232+
docker build -t quay.io/<your-username>/console-operator:latest .
233233
# push container
234-
docker push quay.io/benjaminapetersen/console-operator:latest
234+
docker push quay.io/<your-username>/console-operator:latest
235235
# delete pod, trigger a new pull & deploy
236236
oc delete pod console-operator --namespace openshift-console-operator
237237
```
@@ -281,4 +281,4 @@ oc adm release extract
281281
## Quick Starts
282282

283283
See the [Quick Starts README](quickstarts/README.md) for contributing console
284-
quick starts.
284+
quick starts.

0 commit comments

Comments
 (0)