exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 175 discussion

Actual exam question from Cisco's 350-901
Question #: 175
Topic #: 1
[All 350-901 Questions]


Refer to the exhibit. A developer wants to automatically deploy infrastructure for a containerized application. A .gitlab-ci.yml file must describe a pipeline that builds a container based on a supplied Dockerfile and executes an Ansible playbook on the configured container. What must be added where the code is missing to complete the script?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: C

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
6 months, 2 weeks ago
The missing command in the script should be one that pushes the newly built Docker image to the specified container registry on GitLab. This action is typically performed after building and committing the Docker image. The correct command to complete the script is: C. docker push registry.gitlab.com/$DOCKER_USERNAME/$DOCKER_REPOSITORY
upvoted 2 times
...
doble_h
11 months, 3 weeks ago
asked chatgpt In a GitLab CI/CD pipeline, the after_script is used to specify commands that should be run after the script has executed, regardless of the result of the script. It's commonly used for cleanup, notifying other services, or any other finishing steps. Based on the previous exhibit which is about deploying infrastructure for a containerized application, after building the container and running an Ansible playbook, you might want to include commands in the after_script section that: Push the built Docker image to a Docker registry if the build and Ansible steps were successful. Remove the Docker container to clean up the CI/CD environment. Collect logs or artifacts from the container for further analysis or debugging.
upvoted 1 times
...
ThePokemonNuzlockingMaster
1 year, 4 months ago
The main reason I prefer D instead of C is because of the second line of C where it specified the $DOCKER USERNAME and $DOCKER REPOSITORY. This is incorrect syntax, but also wouldn't be needed anyway since these are specified earlier on in the docker login command. If it wasn't for that, I would think C is more appropriate. However, in my opinion, this can't be right as the syntax is incorrect.
upvoted 1 times
...
AZRA06887
1 year, 4 months ago
After a conversation with chatgpt: Given the requirement to automatically deploy infrastructure for a containerized application and the presence of the docker login command in the script, it is indeed more appropriate to prioritize option C (docker push) over option D (docker logout) in the after_script section. The docker push command ensures that the built container image is pushed to the Docker registry, making it available for deployment. On the other hand, docker logout simply performs a logout action, which may not be directly related to the deployment process. Therefore, in this specific scenario, it is recommended to include option C (docker push) in the after_script section rather than option D (docker logout).
upvoted 1 times
...
cj_kuo
1 year, 7 months ago
I will take the answer as D, because neither answer A,B,C got incorrect command format.
upvoted 1 times
...
[Removed]
1 year, 8 months ago
I asked ChatGPT and it replied: C. - docker push registry.gitlab.com/$DOCKER_USERNAME/$DOCKER_REPOSITORY The docker push command is used to upload a local Docker image to a remote repository such as the GitLab Container Registry. In this script, the built Docker image is stored locally and must be pushed to the GitLab Container Registry in order to make it accessible to other stages in the pipeline. How confident are you in your answer? I am highly confident in my answer.
upvoted 2 times
...
Teringzooi
2 years, 1 month ago
Correct answer seems to be D - docker logout https://github.com/willhallonline/docker-ansible/blob/master/.gitlab-ci.yml https://docs.docker.com/engine/reference/commandline/logout/
upvoted 1 times
...
QuiShong
2 years, 4 months ago
I think C is correct. First the image needs to be pushed to the repo.
upvoted 2 times
Teringzooi
2 years ago
I already pushed, one rule before.
upvoted 1 times
[Removed]
2 years ago
Are you sure? The previous command is "commit". According to this, it seems that commit is not the same as PUSH: https://docs.docker.com/engine/reference/commandline/push/ Still in doubt if C or D .... please anyone clarify this.
upvoted 1 times
...
...
...
bboycoi
2 years, 5 months ago
D https://docs.docker.com/engine/reference/commandline/logout/
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago