Skip to content
devopsbymuh_

DCA practice questions and answers

All 55 questions from Full Practice Test 1 for Docker Certified Associate (DCA), with the correct answer and a full explanation for each — including why the other options are wrong. Free to read, no signup.

What this set covers

Questions are weighted to match the official DCA exam guide. The real exam is 13 multiple choice and 42 discrete option multiple choice (DOMC) questions (55 total) questions in 90 minutes with a pass mark of Not published (~65-70%, unofficial).

  • Orchestration14 q · 25%
  • Image Creation, Management, and Registry11 q · 20%
  • Installation and Configuration8 q · 15%
  • Networking8 q · 15%
  • Security8 q · 15%
  • Storage and Volumes6 q · 10%
Question 1Storage and Volumes

Which mount type stores data only in the host's memory and never writes it to disk?

  • Atmpfs mount
  • Bbind mount
  • Cnamed volume
  • Danonymous volume

Correct answer: A tmpfs mount

A tmpfs mount is backed by RAM, which suits short-lived sensitive data that must not persist. Bind mounts and both volume types write to the host filesystem.

Docker — tmpfs mounts
Question 2Security

Which feature verifies image signatures so that only signed images may be pulled?

  • ADocker Content Trust
  • BDocker Compose profiles
  • CDocker buildx bake
  • DDocker context

Correct answer: A Docker Content Trust

Content Trust uses Notary signatures so the client refuses unsigned or tampered images when enabled. Compose profiles select which services run, buildx bake orchestrates builds, and contexts switch which engine the CLI targets.

Docker — Content trust
Question 3Security

Which practice best limits the blast radius of a leaked registry credential used by CI?

  • AUse a scoped, short-lived token with push access only to the specific repository
  • BUse an administrator account's password so all repositories work
  • CCommit the credential to the application repository
  • DReuse the same credential across every team

Correct answer: A Use a scoped, short-lived token with push access only to the specific repository

A narrowly scoped, short-lived token means a leak affects one repository for a limited time. Administrator credentials, committed secrets, and shared credentials all maximise the damage of a single leak.

Docker — Access tokens
Question 4Orchestration

Which constraint expression schedules a service only onto worker nodes labelled with region=eu?

  • A--constraint 'node.labels.region == eu'
  • B--label region=eu
  • C--env REGION=eu
  • D--network eu

Correct answer: A --constraint 'node.labels.region == eu'

Placement constraints match node attributes and labels to decide where tasks may run. A service label is metadata on the service, an environment variable is passed to the container, and a network attachment does not influence placement.

Docker — Service placement constraints
Question 5Orchestration

Which command scales a running swarm service named web to six replicas?

  • Adocker service scale web=6
  • Bdocker container run --replicas 6 web
  • Cdocker node update --replicas 6 web
  • Ddocker stack rm web

Correct answer: A docker service scale web=6

docker service scale sets the desired replica count for a replicated service, and docker service update --replicas does the same. Container run creates a standalone container, node update changes node properties, and stack rm removes a stack.

Docker — Scale a service
Question 6Image Creation, Management, and Registry

Which command removes dangling images that are no longer referenced by any tag?

  • Adocker image prune
  • Bdocker container prune
  • Cdocker volume prune
  • Ddocker network prune

Correct answer: A docker image prune

image prune deletes dangling images, and with the all flag it removes any image not used by a container. The container, volume, and network prune commands clean up those object types instead.

Docker — docker image prune
Question 7Networking

Which network driver allows containers on different Docker hosts in a swarm to communicate directly?

  • Aoverlay
  • Bbridge
  • Chost
  • Dnone

Correct answer: A overlay

Overlay networks span hosts using VXLAN so swarm services communicate across the cluster. bridge is single-host, host shares the node's network namespace, and none disables networking.

Docker — Overlay network driver
Question 8Installation and Configuration

Which restart policy causes a container to be restarted automatically unless it was explicitly stopped, including after a daemon restart?

  • Aunless-stopped
  • Bno
  • Con-failure with no maximum retry count
  • Dalways-off

Correct answer: A unless-stopped

unless-stopped restarts the container on daemon start except when the user stopped it deliberately. no never restarts, on-failure only restarts after a non-zero exit, and always-off is not a valid policy.

Docker — Restart policies
Question 9OrchestrationSelect 2

Which two service update options control how a rolling update proceeds in swarm mode? (Select TWO.)

  • A--update-parallelism
  • B--update-delay
  • C--publish-add
  • D--mount-add
  • E--label-add

Correct answer: A, B --update-parallelism · --update-delay

Parallelism sets how many tasks update at once and delay sets the pause between batches, which together define the rollout pace. Publish, mount, and label options change the service definition rather than the update strategy.

Docker — Rolling updates
Question 10Installation and Configuration

Which file is used to configure the Docker daemon's options such as log driver, storage driver, and registry mirrors?

  • A/etc/docker/daemon.json
  • B/etc/docker/config.yml
  • C~/.docker/config.json
  • D/etc/default/containerd

Correct answer: A /etc/docker/daemon.json

daemon.json is the engine's configuration file for daemon-level settings. There is no config.yml at that path, the user-level config.json stores CLI settings such as registry credentials, and the containerd defaults file configures a different component.

Docker — Daemon configuration file
Question 11Networking

Which option encrypts data traffic on an overlay network between swarm nodes?

  • ACreate the overlay network with the --opt encrypted flag
  • BEnable TLS on the Docker CLI
  • CUse the bridge driver instead
  • DPublish all ports in host mode

Correct answer: A Create the overlay network with the --opt encrypted flag

The encrypted option enables IPSec encryption of the VXLAN data plane between nodes, whereas control plane traffic is always encrypted. CLI TLS protects the client connection, the bridge driver is single-host, and host mode publishing changes ingress rather than encrypting east-west traffic.

Docker — Encrypt traffic on an overlay network
Question 12Orchestration

Which feature automatically reverts a service to its previous specification when an update fails health checks?

  • A--update-failure-action rollback on the service
  • Bdocker service rm followed by recreate
  • Cdocker node demote
  • Ddocker swarm leave

Correct answer: A --update-failure-action rollback on the service

Setting the failure action to rollback makes swarm return to the previous service definition when the configured failure ratio is exceeded. Removing and recreating loses the previous spec, demote changes a manager to a worker, and leave removes the node from the swarm.

Docker — Rollback a service
Question 13Networking

Which flag publishes container port 80 on host port 8080?

  • A-p 8080:80
  • B-p 80:8080
  • C--expose 8080
  • D--link 8080:80

Correct answer: A -p 8080:80

The publish flag takes host port first and container port second. The reversed form publishes the wrong mapping, expose only documents a port without publishing it, and link is a deprecated container connection feature.

Docker — Published ports
Question 14Orchestration

Which command shows the individual tasks of a service, including their current state and the node they run on?

  • Adocker service ps web
  • Bdocker service ls
  • Cdocker node ls
  • Ddocker image ls

Correct answer: A docker service ps web

docker service ps lists each task with its desired state, current state, node, and any error. service ls summarises services, node ls lists swarm nodes, and image ls lists images.

Docker — Inspect a service
Question 15Image Creation, Management, and RegistrySelect 2

Which two are true about image tags and digests? (Select TWO.)

  • AA digest identifies exact image content and does not change
  • BA tag is a mutable pointer that can be moved to different content
  • CA tag guarantees byte-identical content over time
  • DA digest changes each time the image is pulled
  • EAn image can have only one tag

Correct answer: A, B A digest identifies exact image content and does not change · A tag is a mutable pointer that can be moved to different content

Digests are content hashes and are stable, while tags are human-friendly labels that can be repointed. Tags therefore give no content guarantee, digests do not change on pull, and one image can carry many tags.

Docker — Image names and tags
Question 16Image Creation, Management, and Registry

Which mechanism scans images stored in a registry for known vulnerabilities so results are available before deployment?

  • ARegistry image scanning integrated into the push workflow
  • Bdocker stats
  • Cdocker system df
  • Ddocker inspect

Correct answer: A Registry image scanning integrated into the push workflow

Scanning at push time inventories image contents and matches them against vulnerability databases, so findings are known before anything is deployed. stats shows live resource usage, system df reports disk usage, and inspect prints object metadata.

Docker — Image security scanning
Question 17Storage and VolumesSelect 2

Which two statements about bind mounts are correct? (Select TWO.)

  • AThey map a specific host path into the container, so the host directory structure matters
  • BThey are useful in development for live-reloading source code
  • CThey are managed by the Docker engine in its storage area
  • DThey work identically across hosts regardless of filesystem layout
  • EThey are the recommended mechanism for production data persistence

Correct answer: A, B They map a specific host path into the container, so the host directory structure matters · They are useful in development for live-reloading source code

Bind mounts attach an exact host path, which makes them convenient for local development but dependent on the host's layout. They are not engine-managed, they are not portable between differently laid out hosts, and volumes are the recommended production choice.

Docker — Bind mounts
Question 18Image Creation, Management, and Registry

Which Dockerfile technique keeps compilers and build dependencies out of the final image?

  • AA multi-stage build that copies only the compiled artefact into a minimal final stage
  • BRunning apt-get clean at the end of a single stage
  • CUsing the VOLUME instruction
  • DAdding a HEALTHCHECK instruction

Correct answer: A A multi-stage build that copies only the compiled artefact into a minimal final stage

Multi-stage builds discard everything from earlier stages except what is explicitly copied forward, so build tooling never reaches the shipped image. Cleaning package caches helps a little but leaves the tools installed, and VOLUME and HEALTHCHECK serve unrelated purposes.

Docker — Multi-stage builds
Question 19Installation and ConfigurationSelect 2

Which two settings are appropriate for a production Docker Engine host? (Select TWO.)

  • AEnable live restore so containers keep running during a daemon restart
  • BConfigure log rotation limits on the default logging driver
  • CExpose the daemon socket over TCP without TLS for remote management
  • DAdd all users to the docker group for convenience
  • EDisable all resource limits on containers

Correct answer: A, B Enable live restore so containers keep running during a daemon restart · Configure log rotation limits on the default logging driver

Live restore avoids workload downtime during engine upgrades and log rotation prevents disk exhaustion. An unencrypted TCP socket is remote root access, broad docker group membership is equivalent to root on the host, and removing resource limits invites noisy neighbours.

Docker — Live restore
Question 20Networking

Two containers are attached to the same user-defined bridge network. How can one reach the other?

  • ABy the other container's name, because Docker provides DNS resolution on user-defined networks
  • BOnly by IP address, because DNS is unavailable
  • COnly through a published host port
  • DOnly if both use host networking

Correct answer: A By the other container's name, because Docker provides DNS resolution on user-defined networks

User-defined bridge networks include an embedded DNS server so container names resolve automatically, unlike the legacy default bridge. Publishing ports is for external access, and host networking is not required for container-to-container traffic.

Docker — Bridge network driver
Question 21Security

Which user namespace feature reduces the impact of a container escape by mapping container root to an unprivileged host user?

  • AUser namespace remapping configured with userns-remap in the daemon settings
  • BRunning the container with --privileged
  • CSetting a container restart policy
  • DPublishing ports in host mode

Correct answer: A User namespace remapping configured with userns-remap in the daemon settings

User namespace remapping means UID 0 inside the container corresponds to an unprivileged UID on the host, so an escape lands with limited rights. Privileged mode removes protections, restart policies govern lifecycle, and host mode publishing concerns networking.

Docker — Isolate containers with a user namespace
Question 22Orchestration

Which command retrieves the token needed to add a new worker node to an existing swarm?

  • Adocker swarm join-token worker
  • Bdocker node inspect self
  • Cdocker service create --name worker
  • Ddocker swarm unlock-key

Correct answer: A docker swarm join-token worker

join-token prints the full join command including the worker token. node inspect shows node details, service create deploys a service, and unlock-key relates to autolock rather than joining.

Docker — Join nodes to a swarm
Question 23Orchestration

Which node availability state drains all tasks from a node and prevents new tasks being scheduled to it?

  • Adrain
  • Bactive
  • Cpause
  • Dready

Correct answer: A drain

Setting availability to drain evicts running tasks and blocks new scheduling, which is what you do before maintenance. Active is the normal state, pause blocks new tasks but leaves existing ones running, and ready is a node status rather than an availability setting.

Docker — Manage nodes in a swarm
Question 24SecuritySelect 2

Which two container run options reduce privilege? (Select TWO.)

  • A--cap-drop ALL with selective --cap-add
  • B--read-only with tmpfs mounts for writable paths
  • C--privileged
  • D-v /:/host
  • E--pid host

Correct answer: A, B --cap-drop ALL with selective --cap-add · --read-only with tmpfs mounts for writable paths

Dropping capabilities and running with a read-only root filesystem both narrow what a compromised process can do. Privileged mode, mounting the host root, and sharing the host PID namespace each give a container a direct path to the host.

Docker — Runtime privilege and Linux capabilities
Question 25Image Creation, Management, and Registry

What is the difference between the CMD and ENTRYPOINT instructions?

  • AENTRYPOINT sets the executable that always runs, while CMD supplies default arguments that a docker run argument can override
  • BCMD always runs first and ENTRYPOINT is ignored
  • CBoth are identical and interchangeable
  • DENTRYPOINT can only be used in the first stage of a build

Correct answer: A ENTRYPOINT sets the executable that always runs, while CMD supplies default arguments that a docker run argument can override

ENTRYPOINT defines the fixed command and CMD provides overridable defaults, which is why they are often used together. They are not interchangeable, CMD does not take precedence over ENTRYPOINT, and ENTRYPOINT has no stage restriction.

Docker — Dockerfile reference
Question 26Storage and Volumes

What happens to an anonymous volume when its container is removed with docker rm -v?

  • AThe anonymous volume is removed along with the container
  • BIt is renamed and retained forever
  • CIt is converted to a named volume
  • DIt is pushed to the registry

Correct answer: A The anonymous volume is removed along with the container

The -v flag removes anonymous volumes associated with the container, which is why named volumes are preferred for data you intend to keep. Volumes are not renamed, promoted to named volumes, or pushed anywhere.

Docker — docker rm
Question 27Image Creation, Management, and Registry

Which instruction in a Dockerfile has no effect on the resulting image's filesystem layers but sets metadata used at container start?

  • AENV, EXPOSE, and LABEL create metadata rather than filesystem content
  • BRUN creates only metadata
  • CCOPY creates only metadata
  • DADD creates only metadata

Correct answer: A ENV, EXPOSE, and LABEL create metadata rather than filesystem content

ENV, EXPOSE, and LABEL record configuration and documentation in the image manifest without adding files. RUN, COPY, and ADD all write content into the filesystem.

Docker — Dockerfile reference
Question 28Image Creation, Management, and Registry

Which file prevents unnecessary files from being sent to the build context and ending up in the image?

  • A.dockerignore
  • B.gitignore
  • Cdocker-compose.override.yml
  • Ddaemon.json

Correct answer: A .dockerignore

.dockerignore excludes paths from the build context, which speeds builds and prevents secrets or artefacts being copied in. .gitignore affects version control, the Compose override file adjusts service definitions, and daemon.json configures the engine.

Docker — .dockerignore file
Question 29Orchestration

Which object distributes non-sensitive configuration files to swarm service tasks without rebuilding the image?

  • ADocker config
  • BDocker secret
  • CDocker volume
  • DDocker network

Correct answer: A Docker config

Swarm configs mount non-sensitive files into service tasks and are versioned in the swarm's Raft store. Secrets are for sensitive material, volumes provide persistent storage, and networks connect containers.

Docker — Store configuration data using Docker configs
Question 30Installation and Configuration

Which logging driver should be configured to prevent container logs from filling the disk on a busy node?

  • Ajson-file with max-size and max-file options, or a remote driver such as syslog
  • Bjson-file with no options set
  • Cnone, so that no diagnostics are ever available
  • DThe default driver with logging disabled at the container level only

Correct answer: A json-file with max-size and max-file options, or a remote driver such as syslog

Log rotation options bound the on-disk size, and a remote driver moves logs off the node entirely. Unbounded json-file is the problem, and turning logging off removes the diagnostics you need during incidents.

Docker — Configure logging drivers
Question 31Image Creation, Management, and Registry

Which command tags a local image so it can be pushed to a private registry at registry.example.com?

  • Adocker tag myapp:1.0 registry.example.com/team/myapp:1.0
  • Bdocker commit myapp registry.example.com
  • Cdocker save myapp -o myapp.tar
  • Ddocker export myapp > myapp.tar

Correct answer: A docker tag myapp:1.0 registry.example.com/team/myapp:1.0

The registry host is part of the image reference, so tagging with the full name is what lets docker push target that registry. commit creates an image from a container, save writes an image archive, and export writes a container filesystem archive.

Docker — docker tag
Question 32Storage and Volumes

Which mechanism allows a volume to be backed by external storage such as NFS or a cloud block device?

  • AA volume driver plugin specified when creating the volume
  • BThe overlay2 storage driver
  • CA tmpfs mount
  • DA .dockerignore entry

Correct answer: A A volume driver plugin specified when creating the volume

Volume plugins let third-party or built-in drivers provide storage from external systems while presenting a normal volume to containers. The storage driver handles image and container layers, tmpfs is memory-backed, and .dockerignore filters the build context.

Docker — Volume plugins
Question 33Networking

A swarm service must be reachable only on nodes actually running its tasks, bypassing the routing mesh. Which publish mode achieves this?

  • Amode=host publishing
  • Bmode=ingress publishing
  • CAttaching the service to a bridge network
  • DSetting the service to global mode

Correct answer: A mode=host publishing

Host mode publishing binds the port directly on nodes that run a task and skips the ingress routing mesh. Ingress mode is the routing mesh, a bridge network is single-host, and global mode changes replica placement rather than publishing behaviour.

Docker — Publish ports in host mode
Question 34Image Creation, Management, and Registry

What is the difference between docker save and docker export?

  • Asave writes an image with all its layers and metadata, while export writes a container's flattened filesystem without history
  • Bsave works on containers and export works on images
  • CBoth produce identical archives
  • Dexport preserves image tags and layer history

Correct answer: A save writes an image with all its layers and metadata, while export writes a container's flattened filesystem without history

save archives an image including layers and tags so it can be loaded elsewhere, while export flattens a container's filesystem and loses layer history and metadata. Their subjects are not reversed, the archives differ, and export specifically drops history.

Docker — docker save
Question 35OrchestrationSelect 2

Which two statements about swarm managers are correct? (Select TWO.)

  • AManagers also act as workers by default unless their availability is set to drain
  • BAn odd number of managers is recommended to maintain quorum
  • CManagers cannot run tasks under any configuration
  • DAdding more managers always improves scheduling throughput
  • EA single manager swarm is fault tolerant

Correct answer: A, B Managers also act as workers by default unless their availability is set to drain · An odd number of managers is recommended to maintain quorum

Managers are schedulable by default and an odd manager count gives the best fault tolerance for a given size. Managers can run tasks, adding managers increases Raft coordination overhead rather than throughput, and one manager is a single point of failure.

Docker — Administer and maintain a swarm
Question 36Orchestration

Which command deploys a multi-service application defined in a Compose file to a swarm?

  • Adocker stack deploy -c docker-compose.yml myapp
  • Bdocker compose up -d
  • Cdocker service create -f docker-compose.yml
  • Ddocker swarm join-token worker

Correct answer: A docker stack deploy -c docker-compose.yml myapp

docker stack deploy reads a Compose file and creates the corresponding swarm services, networks, and configs. docker compose up runs containers on a single engine, service create does not accept a Compose file, and join-token prints the token for adding nodes.

Docker — Deploy a stack to a swarm
Question 37Installation and ConfigurationSelect 2

Which two facts about the overlay2 storage driver are correct? (Select TWO.)

  • AIt is the recommended default storage driver on modern Linux kernels
  • BIt uses copy-on-write, so writing to a file in a lower layer copies it into the container layer
  • CIt stores container writes directly into the image layers
  • DIt requires a dedicated block device on every host
  • EIt disables layer sharing between images

Correct answer: A, B It is the recommended default storage driver on modern Linux kernels · It uses copy-on-write, so writing to a file in a lower layer copies it into the container layer

overlay2 is the default on current kernels and uses copy-on-write so modifications land in the writable container layer. Image layers stay read-only, no dedicated block device is required, and layer sharing between images is one of its benefits.

Docker — Storage drivers
Question 38Storage and Volumes

A swarm service must keep its data when its task is rescheduled to a different node. What is required?

  • AShared or networked storage exposed through a volume driver available on all nodes
  • BA local named volume on the original node
  • CA bind mount to /tmp on each node
  • DA tmpfs mount in the service definition

Correct answer: A Shared or networked storage exposed through a volume driver available on all nodes

Local volumes do not follow a task to another node, so persistence across rescheduling requires storage reachable from every node through a suitable driver. Local volumes, per-node bind mounts, and tmpfs all leave the data behind or discard it.

Docker — Use volumes with services
Question 39Networking

Which command inspects a network to see which containers are attached and what subnet is in use?

  • Adocker network inspect <name>
  • Bdocker network ls
  • Cdocker port <container>
  • Ddocker stats

Correct answer: A docker network inspect <name>

network inspect returns the IPAM configuration and the list of attached containers with their addresses. ls only lists networks, port shows published mappings for one container, and stats shows resource usage.

Docker — docker network inspect
Question 40Installation and Configuration

Which command displays engine-level information including the storage driver, number of containers, and swarm status?

  • Adocker info
  • Bdocker version
  • Cdocker inspect
  • Ddocker ps -a

Correct answer: A docker info

docker info reports daemon configuration and runtime state, including storage driver and swarm membership. version prints client and server versions, inspect returns details of a specific object, and ps lists containers.

Docker — docker info
Question 41Security

Which securing practice applies to the Docker daemon socket when remote access is required?

  • AEnable TLS with mutual certificate authentication on the TCP endpoint
  • BBind the TCP endpoint to 0.0.0.0 without TLS
  • CShare the Unix socket over NFS
  • DDisable authentication so automation is simpler

Correct answer: A Enable TLS with mutual certificate authentication on the TCP endpoint

Mutual TLS ensures only clients holding a trusted certificate can reach the daemon, which is essential because socket access is root-equivalent. Unauthenticated TCP exposure, sharing the socket over a file share, and disabling authentication all hand out host root.

Docker — Protect the Docker daemon socket
Question 42Installation and Configuration

Which command shows disk usage by images, containers, volumes, and build cache?

  • Adocker system df
  • Bdocker stats
  • Cdocker info
  • Ddocker events

Correct answer: A docker system df

system df breaks down reclaimable and active space per object type. stats shows live CPU and memory per container, info summarises engine configuration, and events streams daemon events.

Docker — docker system df
Question 43Image Creation, Management, and Registry

Which statement about the difference between COPY and ADD is correct?

  • ACOPY only copies local files, while ADD additionally handles remote URLs and automatic archive extraction
  • BADD only copies local files and COPY handles URLs
  • CThey are functionally identical in every case
  • DCOPY can only be used in the final build stage

Correct answer: A COPY only copies local files, while ADD additionally handles remote URLs and automatic archive extraction

ADD has extra behaviours around URLs and tar extraction, which is why COPY is preferred when those behaviours are not wanted. Their roles are not reversed, they are not identical, and COPY works in any stage.

Docker — Dockerfile reference
Question 44Orchestration

Which command initialises a new Docker Swarm and makes the current node a manager?

  • Adocker swarm init
  • Bdocker swarm join
  • Cdocker node promote
  • Ddocker stack deploy

Correct answer: A docker swarm init

docker swarm init creates the swarm and makes the local node its first manager. join adds a node to an existing swarm, promote changes an existing worker to a manager, and stack deploy deploys services once a swarm exists.

Docker — Create a swarm
Question 45Security

Why is adding a user to the docker group equivalent to granting root access on the host?

  • ABecause the user can start a privileged container that mounts the host filesystem
  • BBecause the docker group is an alias for the root group
  • CBecause the daemon runs as the invoking user
  • DBecause docker commands require sudo regardless

Correct answer: A Because the user can start a privileged container that mounts the host filesystem

Access to the daemon socket means the user can run a container with the host root mounted and full privileges, which is root by another route. The group is not an alias for root, the daemon runs as root rather than as the caller, and members do not need sudo.

Docker — Docker daemon attack surface
Question 46Image Creation, Management, and RegistrySelect 2

Which two Dockerfile practices improve build cache efficiency? (Select TWO.)

  • ACopy dependency manifests and install dependencies before copying the rest of the source
  • BOrder instructions so the least frequently changing layers come first
  • CCopy the entire source tree as the first instruction
  • DCombine every command into one RUN at the very top
  • EUse a different base image on every build

Correct answer: A, B Copy dependency manifests and install dependencies before copying the rest of the source · Order instructions so the least frequently changing layers come first

The cache invalidates from the first changed layer onward, so putting stable steps early and installing dependencies before copying source keeps expensive layers reusable. Copying everything first invalidates the cache on any source change, and changing the base image each build defeats caching entirely.

Docker — Build cache
Question 47Networking

Which network driver assigns a container its own MAC address so it appears as a physical device on the LAN?

  • Amacvlan
  • Bbridge
  • Coverlay
  • Dnone

Correct answer: A macvlan

macvlan gives each container a MAC address on the physical network, which suits legacy applications expecting to be directly on the LAN. bridge and overlay use virtual networks with NAT or tunnelling, and none disables networking.

Docker — Macvlan network driver
Question 48Installation and Configuration

A container must be limited to one CPU and 512 MB of memory. Which run flags express this?

  • A--cpus=1 --memory=512m
  • B--cpu-shares=1 --memory-swap=512m
  • C--ulimit cpu=1 --ulimit mem=512
  • D--oom-kill-disable --memory-reservation=512m

Correct answer: A --cpus=1 --memory=512m

cpus sets a hard CPU quota and memory sets a hard memory limit. cpu-shares is a relative weight rather than a limit, ulimits are per-process limits with different semantics, and a reservation is a soft target while disabling OOM kill is dangerous.

Docker — Runtime options with memory and CPUs
Question 49Security

Which mechanism distributes sensitive values such as passwords to swarm services with encryption at rest and in transit?

  • ADocker secrets, mounted into the task's in-memory filesystem
  • BEnvironment variables set in the service definition
  • CA bind mount from the host filesystem
  • DA build argument baked into the image

Correct answer: A Docker secrets, mounted into the task's in-memory filesystem

Swarm secrets are stored encrypted in the Raft log, sent over mutual TLS, and exposed to tasks in a memory-backed filesystem. Environment variables are visible in service inspection, bind mounts leave the secret on disk, and build arguments end up in image history.

Docker — Manage sensitive data with Docker secrets
Question 50Storage and Volumes

Which storage option is managed by Docker, survives container removal, and is the recommended way to persist data?

  • AA named volume
  • BThe container's writable layer
  • CA tmpfs mount
  • DAn image layer

Correct answer: A A named volume

Named volumes are managed by the engine, live outside the container lifecycle, and are the recommended persistence mechanism. The writable layer is deleted with the container, tmpfs is memory-backed and ephemeral, and image layers are read-only.

Docker — Volumes
Question 51NetworkingSelect 2

Which two statements about the host network driver are correct? (Select TWO.)

  • AThe container shares the host's network namespace and its ports bind directly on the host
  • BThere is no network isolation between the container and the host
  • CPort publishing with -p is required to reach the container
  • DIt works identically across Linux and all other platforms with full parity
  • EContainers on host networking get their own IP address

Correct answer: A, B The container shares the host's network namespace and its ports bind directly on the host · There is no network isolation between the container and the host

Host networking removes the separate namespace, so the container binds host ports directly and gains no network isolation. Publishing is unnecessary and ignored, platform behaviour differs outside Linux, and the container uses the host's addresses rather than its own.

Docker — Host network driver
Question 52Orchestration

What does the swarm routing mesh provide for a service published on port 8080?

  • AAny node in the swarm accepts traffic on that port and forwards it to a task, even if no task runs locally
  • BOnly nodes running a task will accept traffic on that port
  • CTraffic is routed based on HTTP host headers
  • DTraffic is encrypted end to end by default without configuration

Correct answer: A Any node in the swarm accepts traffic on that port and forwards it to a task, even if no task runs locally

The routing mesh makes the published port reachable on every node and load balances into the service's tasks. Restricting to task-bearing nodes is host mode publishing, host-header routing is a layer 7 proxy feature, and overlay data encryption is opt-in.

Docker — Use swarm mode routing mesh
Question 53SecuritySelect 2

Which two are true about swarm mode's built-in security? (Select TWO.)

  • ANodes communicate over mutual TLS with automatically rotated certificates
  • BThe swarm can be autolocked so the Raft log encryption key is not stored on disk unencrypted
  • CControl plane traffic is unencrypted by default
  • DJoin tokens grant read-only access only
  • ESecrets are stored in plaintext in the Raft log

Correct answer: A, B Nodes communicate over mutual TLS with automatically rotated certificates · The swarm can be autolocked so the Raft log encryption key is not stored on disk unencrypted

Swarm establishes a certificate authority and uses mutual TLS with rotation, and autolock protects the Raft encryption key at rest. Control plane traffic is encrypted by default, a manager join token grants manager privileges, and secrets are encrypted in the Raft log.

Docker — Swarm mode security
Question 54Orchestration

Which service mode runs exactly one task on every node in the swarm?

  • AGlobal mode
  • BReplicated mode
  • CRollback mode
  • DDetached mode

Correct answer: A Global mode

A global service places one task per eligible node and adds tasks automatically as nodes join. Replicated mode runs a fixed number of tasks anywhere in the swarm, and rollback and detached are not service modes.

Docker — Replicated and global services
Question 55Orchestration

In a swarm with five managers, how many managers must be available for the cluster to keep accepting management commands?

  • AThree, because a quorum is more than half the managers
  • BTwo
  • COne
  • DAll five

Correct answer: A Three, because a quorum is more than half the managers

Swarm managers use Raft, which requires a majority to elect a leader and commit changes, so five managers tolerate two failures and need three available. Two or one is below quorum, and requiring all five would provide no fault tolerance at all.

Docker — Raft consensus in swarm mode

Ready to try it under exam conditions?

Reading answers is not the same as recalling them with a clock running. Take the same 55 questions as a timed mock exam — 90 minutes, no feedback until you submit, then a score broken down by exam domain so you know what to study.

Start the timed DCA test →