Which option in the oc new-app command is used to specify the directory within a Git repository to use for the build?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

Which option in the oc new-app command is used to specify the directory within a Git repository to use for the build?

Explanation:
In OpenShift, the build context inside a Git repository is chosen with the flag that specifies the subdirectory to use for the build. The best option is the one that sets the context directory, telling OpenShift which folder in the repository contains the application sources and Dockerfile. This is needed when the repo holds multiple apps or when the build should start from a subfolder rather than the repository root. The other proposed flags don’t apply here because they aren’t used by oc new-app to designate a subdirectory within the Git repository. Use this flag with a value like path/to/app to target the correct directory.

In OpenShift, the build context inside a Git repository is chosen with the flag that specifies the subdirectory to use for the build. The best option is the one that sets the context directory, telling OpenShift which folder in the repository contains the application sources and Dockerfile. This is needed when the repo holds multiple apps or when the build should start from a subfolder rather than the repository root. The other proposed flags don’t apply here because they aren’t used by oc new-app to designate a subdirectory within the Git repository. Use this flag with a value like path/to/app to target the correct directory.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy