-
Bug
-
Resolution: Done
-
Minor
-
DO288 - OCP4.12-en-4-20240304
-
None
-
False
-
-
False
-
3
-
en-US (English)
Please fill in the following information:
https://rol.redhat.com/rol/app/courses/do288-4.12/pages/ch03
Issue description
The section "Expose Ports" incorrectly states:
In contrast, adding a new application from the OpenShift web console typically does not use the EXPOSE value. You must set the port explicitly by using web forms.
The port that is suggested in "Advanced options" section of the image deployment workflow is the first port found in the list of exposed ports (using the EXPOSE directive), but any other ports declared in EXPOSE also appear in the dropdown list.
What is not used any more (by either the web console or the oc new-app command) is the label io.openshift.expose-services.
$ podman inspect registry.ocp4.example.com:8443/redhattraining/php-hello-dockerfile:latest | jq .[0].Config.ExposedPorts { "8080/tcp": {} } $ cat Containerfile FROM registry.ocp4.example.com:8443/redhattraining/php-hello-dockerfile:latest USER 0 RUN sed -i 's/Listen 8080/Listen 1234/' /etc/httpd/conf/httpd.conf USER 1001 EXPOSE 1234/tcp $ podman build -t php-hello-newport:latest . ... $ podman inspect php-hello-newport:latest | jq .[0].Config.ExposedPorts { "1234/tcp": {}, "8080/tcp": {} } $ skopeo copy containers-storage:localhost/php-hello-newport:latest docker://registry.ocp4.example.com:8443/developer/php-hello-newport:latest ...
After performing the above, the OpenShift web console will show both ports in target port selection drop-down list, with 1234 being the default selection (see screenshots below).