ExamGecko
Home Home / Docker / DCA

Docker DCA Practice Test - Questions Answers, Page 10

Question list
Search
Search

List of questions

Search

Related questions











A users attempts to set the system time from inside a Docker container are unsuccessful. Could this be blocking this operation?

Solution: Linux capabilities

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: A

Explanation:

: = Linux capabilities are a way of restricting the privileges of a process or a container.By default, Docker containers run with a reduced set of capabilities, which means they cannot perform certain operations that require higher privileges, such as setting the system time1.To allow a container to set the system time, you need to grant it the SYS_TIME capability by using the--cap-addoption when running the container2.For example,docker run --cap-add SYS_TIME alpine date -s 12:00would set the system time to 12:00 inside the alpine container3.Reference:Docker Documentation,Runtime privilege and Linux capabilities,Change system date time in Docker containers without impacting host,Is it possible to change time dynamically in docker container?

Your organization has a centralized logging solution, such as Splunk.

Will this configure a Docker container to export container logs to the logging solution?

Solution: docker system events --filter splunk

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: B

Explanation:

= The solution will not configure a Docker container to export container logs to the logging solution, such as Splunk. The commanddocker system events --filter splunkis not a valid command to send logs to a remote destination.The--filteroption fordocker system eventsonly accepts the following keys:container,daemon,event,image,label,network,plugin,type, andvolume1.splunkis not a valid key for filtering events.To configure a Docker container to export container logs to a logging solution, such as Splunk, you need to use the--log-driverand--log-optoptions when creating or running the container2. For example, to use the Splunk logging driver, you can use the following command:

docker run --log-driver=splunk --log-opt splunk-token=176FCEBF-4CF5-4EDF-91BC-703796522D20 --log-opt splunk-url=https://splunkhost:8088 ...

This command will send the container logs to the Splunk HTTP Event Collector (HEC) endpoint specified by thesplunk-urloption, using the authentication token provided by thesplunk-tokenoption3.You can also use other logging drivers, such assyslog,fluentd,gelf, etc., depending on your logging solution4.Reference:

1: docker system events | Docker Docs

2: Configure logging drivers | Docker Docs

3: Splunk logging driver | Docker Docs

4: Supported logging drivers | Docker Docs

Your organization has a centralized logging solution, such as Splunk.

Will this configure a Docker container to export container logs to the logging solution?

Solution: docker logs <container-id>

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: B

Explanation:

: = The commanddocker logs <container-id>will not configure a Docker container to export container logs to the logging solution, such as Splunk.This command only displays the logs of a specific container in the standard output or a file, but does not send them to any external system1.To export container logs to Splunk, you need to use the Docker Logger Drivers, which are plugins that provide logging capabilities for Docker containers2.The Splunk logging driver sends container logs to HTTP Event Collector in Splunk Enterprise and Splunk Cloud3.To use the Splunk logging driver for a specific container, you need to use the command-line flags--log-driverand--log-optwithdocker run, and provide the Splunk token and URL as options3. For example:

$ docker run --log-driver=splunk --log-opt splunk-token=VALUE --log-opt splunk-url=VALUE ...

docker logs | Docker Documentation

Logging drivers | Docker Documentation

Splunk logging driver | Docker Documentation

Your organization has a centralized logging solution, such as Splunk.

Will this configure a Docker container to export container logs to the logging solution?

Solution: Set the log-driver and log-oPt keys to values for the logging solution (Splunk) In the daemon.json file.

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: A

Explanation:

Setting the log-driver and log-opt keys to values for the logging solution (Splunk) in the daemon.json file will configure a Docker container to export container logs to the logging solution.This is because the Splunk logging driver sends container logs to the HTTP Event Collector in Splunk Enterprise and Splunk Cloud1.To use the Splunk driver as the default logging driver, set the keys log-driver and log-opts to appropriate values in the daemon.json configuration file and restart Docker1.To use the Splunk driver for a specific container, use the commandline flags --log-driver and log-opt with docker run1.The Splunk logging driver supports various options, such as splunk-token, splunk-url, splunk-source, splunk-sourcetype, splunk-index, etc1.Reference: Splunk logging driver | Docker Docs1

A persistentVolumeClaim (PVC) is created with the specification storageClass: '', and size requirements that cannot be satisfied by any existing persistentVolume.

Is this an action Kubernetes takes in this situation?

Solution: The PVC remains unbound until a persistentVolume that matches all requirements of the PVC becomes available.

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: A

Explanation:

= A persistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a Pod.Pods consume node resources and PVCs consume PV resources1.A PVC can specify a storage class, which is a way of requesting a certain quality of service for the volume2.If the storage class is empty, it means the PVC does not have any specific storage class requirements and can be bound to any PV that satisfies its size and access mode3. However, if there is no existing PV that matches the PVC's requirements, the PVC remains unbound until a suitable PV becomes available.This can happen either by manual provisioning by an administrator or by dynamic provisioning using StorageClasses1.Reference:

Persistent Volumes | Kubernetes

Storage Classes | Kubernetes

Configure a Pod to Use a PersistentVolume for Storage | Kubernetes

You created a new service named 'http' and discover it is not registering as healthy. Will this command enable you to view the list of historical tasks for this service?

Solution: 'docker service inspect http'

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: B

Explanation:

= The command 'docker service inspect http' will display detailed information on the 'http' service, such as its ID, name, mode, replicas, container spec, networks, ports, etc. However, it will not show the list of historical tasks for the service.To view the list of tasks, you need to use the command 'docker service ps http', which will show the ID, name, image, node, desired state, current state, and error of each task12.Reference:

1: docker service inspect | Docker Docs

2: docker service ps | Docker Docs

You created a new service named 'http' and discover it is not registering as healthy. Will this command enable you to view the list of historical tasks for this service?

Solution: 'docker inspect http'

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: B

Explanation:

: = The 'docker inspect' command returns low-level information on Docker objects, such as containers, images, networks, etc1It does not show the list of historical tasks for a service.To view the list of tasks for a service, you need to use the 'docker service ps' command2. For example, to see the tasks for the 'http' service, you would run 'docker service ps http'.This would show the ID, name, image, node, desired state, current state, and error of each task2.Reference:Docker inspect | Docker Docs,Docker service ps | Docker Docs

You created a new service named 'http' and discover it is not registering as healthy. Will this command enable you to view the list of historical tasks for this service?

Solution: 'docker service ps http'

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: A

Explanation:

= The command 'docker service ps http' will list the tasks that are running as part of the 'http' service, as well as the task history1. The task history shows the previous states of the tasks, such as running, shutdown, rejected, etc.This can help you troubleshoot why the service is not registering as healthy, by looking at the current state, error, and ports of each task1.Reference:

docker service ps | Docker Docs

Docker Certified Associate Guide

DCA Prep Guide

Will this action upgrade Docker Engine CE to Docker Engine EE?

Solution: Delete '/var/lib/docker' directory.

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: B

Explanation:

Deleting the/var/lib/dockerdirectory will not upgrade Docker Engine CE to Docker Engine EE. It will only remove all the data stored by Docker, such as images, containers, volumes, and networks. This can cause data loss and disrupt the running services. To upgrade from Docker Engine CE to Docker Engine EE, you need to follow the official instructions from Docker, which involve uninstalling the CE package and installing the EE package. You also need to have a valid license to use Docker Engine EE.Reference:

Upgrading Docker CE to EE for the Impatient --- Part I

Install Docker Engine

Moving from docker ce to docker-EE - Stack Overflow

Will this action upgrade Docker Engine CE to Docker Engine EE?

Solution: Uninstall 'docker-ce' package before installing 'docker-ee' package.

A.

Yes

A.

Yes

Answers
B.

No

B.

No

Answers
Suggested answer: B

Explanation:

= Uninstalling the 'docker-ce' package before installing the 'docker-ee' package will not upgrade Docker Engine CE to Docker Engine EE. It will only remove the existing Docker Engine CE installation and install a new Docker Engine EE installation. This means that any existing containers, images, volumes, networks, and other Docker resources will be lost.To upgrade Docker Engine CE to Docker Engine EE without losing any data, you need to use the migration tool provided by Docker1or follow the steps described in the Docker documentation2or other online guides34.Reference:

1: Migrate to Engine 1.10 | Docker Docs

2: Install Docker Engine | Docker Docs

3: Switching Docker 18.09 Community Edition to Enterprise Engine with no ...

4: How to upgrade Docker 18.09 Community Edition to Docker Enterprise 18.09

Total 183 questions
Go to page: of 19