nerdexam
Cisco

300-910 · Question #90

An Ops team sets up a CI/CD pipeline for a Node.js application with GitLab. The latest node Docker image is defined as a service in a job. The team notices that the node commands are unavailable in th

The correct answer is A. Choose a Docker image that contains tools needed to run the node and define it as an image in the job.. When a Node.js Docker image is defined as a service in a GitLab CI/CD job, node commands are unavailable in the main job container because services run as separate linked containers, not the primary execution environment.

CI/CD Pipelines

Question

An Ops team sets up a CI/CD pipeline for a Node.js application with GitLab. The latest node Docker image is defined as a service in a job. The team notices that the node commands are unavailable in the script, and the job fails. Which action resolves the issue?

Exhibit

300-910 question #90 exhibit

Options

  • AChoose a Docker image that contains tools needed to run the node and define it as an image in the job.
  • BDefine a command or script to execute as the container entry point.
  • CConfigure the service entry by using a map as an option.
  • DSpecify a service alias that is used to access the service from the job container.

How the community answered

(38 responses)
  • A
    71% (27)
  • B
    8% (3)
  • C
    16% (6)
  • D
    5% (2)

Why each option

When a Node.js Docker image is defined as a `service` in a GitLab CI/CD job, `node` commands are unavailable in the main job container because services run as separate linked containers, not the primary execution environment.

AChoose a Docker image that contains tools needed to run the node and define it as an image in the job.Correct

In GitLab CI/CD, the `image` keyword defines the Docker image for the primary job container where script commands are executed, while `services` define linked auxiliary containers. To make `node` commands available directly in the job's execution environment, the `image` for the job itself must be set to a Docker image (e.g., `node:latest`) that contains the Node.js runtime and necessary tools.

BDefine a command or script to execute as the container entry point.

Defining an entry point command affects how the *service container* starts, but it does not make the `node` executable available within the *main job container* where the script is attempting to run `node` commands.

CConfigure the service entry by using a map as an option.

Configuring service entries with a map is for passing parameters or environment variables to the *service container*, which does not resolve the issue of the `node` command being absent in the *main job container*.

DSpecify a service alias that is used to access the service from the job container.

A service alias provides a hostname to access the service container from the main job container, but it does not install or make the `node` executable available within the main job container's environment.

Concept tested: GitLab CI/CD Docker image vs. service

Source: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-the-difference-between-image-and-services

Topics

#GitLab CI/CD#Docker Images#CI/CD Pipeline Configuration#Containerized Builds

Community Discussion

No community discussion yet for this question.

Full 300-910 Practice