تدرب على 80 سؤالًا في DevOps تغطي صور Docker والحاويات والأحجام والشبكات و Compose، وعمليات Kubernetes والخدمات والتخزين واستكشاف الأخطاء.
المستوى: Docker & Kubernetesالصعوبة: intermediate80 سؤال50 دقيقة
اقرأ كل سؤال عن Docker أو Kubernetes، واختر أو اكتب إجابتك ثم اطّلع على الشرح.
أيام متتالية: 0 أياممحفوظ على هذا الجهاز فقط
التقدم0 / 80
الوقت المتبقي: 00:00
لا توجد أخطاء محفوظة بعد.
لا توجد أسئلة تطابق عوامل التصفية.
سؤال 1
What does a Docker image contain?
A Docker image packages application code together with the runtime, libraries, and configuration as layered filesystem snapshots. It does not include a separate OS kernel.
سؤال 2
Which Dockerfile instruction sets the base image?
FROM names the base image that the build starts from, such as FROM node:20.
سؤال 3
Which Dockerfile instruction copies files from the build context into the image?
COPY copies files or directories from the build context into the image filesystem.
سؤال 4
Which command builds an image from a Dockerfile?
docker build reads the Dockerfile in the build context and produces an image.
سؤال 5
What does the CMD instruction define?
CMD provides the default command for the container and can be overridden at runtime.
سؤال 6
What does the ENTRYPOINT instruction define?
ENTRYPOINT defines the main executable that runs when the container starts and is harder to override than CMD.
سؤال 7
What is a Dockerfile?
A Dockerfile is a text file that contains build instructions such as FROM, COPY, RUN, and CMD.
سؤال 8
What is a Docker container?
A container is a runnable instance of an image, isolated with its own filesystem, processes, and network.
سؤال 9
Which command lists running containers?
docker ps shows running containers; adding -a also shows stopped containers.
سؤال 10
Which command starts a container from an image?
docker run creates and starts a container from an image.
سؤال 11
What does docker pull do?
docker pull downloads an image from a registry such as Docker Hub to the local Docker daemon.
سؤال 12
What is Docker Hub?
Docker Hub is a registry service for sharing and distributing container images.
سؤال 13
Why does Docker use image layers?
Layers allow Docker to reuse cached build steps, reduce storage, and transfer only changed layers.
سؤال 14
What is a Docker volume used for?
Volumes provide persistent storage that remains available after containers are removed or recreated.
سؤال 15
Which flag is commonly used to mount a volume or bind mount?
The -v or --volume flag mounts a volume or host directory into the container.
سؤال 16
What is a bind mount?
A bind mount maps a directory on the host into a container path, so the container sees host files directly.
سؤال 17
What is a named volume?
Named volumes are managed by Docker and persist independently of container lifecycle.
سؤال 18
Which Docker network driver creates an isolated network for containers on one host?
The bridge driver creates a private network on the host so containers can communicate through it.
سؤال 19
Which Docker network driver lets containers use the host network stack directly?
The host driver removes network isolation and attaches containers directly to the host network.
سؤال 20
What is Docker Compose?
Docker Compose defines multi-container applications in YAML and manages them with simple commands.
سؤال 21
Which file is the default Docker Compose file?
Compose looks for docker-compose.yml or compose.yaml by default.
سؤال 22
What does docker compose up do?
docker compose up creates networks and containers for the services and starts them.
سؤال 23
What is a service in Docker Compose?
Each service in a Compose file defines how one container or group of containers should run.
سؤال 24
Which Compose key specifies the image to use?
The image key tells Compose which image to pull or build for the service.
سؤال 25
Which Compose key maps host ports to container ports?
The ports key publishes container ports to the host, for example 8080:80.
سؤال 26
What does docker exec do?
docker exec runs a command inside an already running container, which is useful for debugging.
سؤال 27
Which command shows logs from a container?
docker logs prints the logs produced by a container. It is the standard command for viewing stdout and stderr output from a running or stopped container. docker ps lists containers, docker pull downloads images, and docker inspect shows detailed configuration rather than logs.
سؤال 28
What is a container registry?
A registry stores images and allows clients to pull and push them.
سؤال 29
Which command tags an image?
docker tag creates a new tag for an image, often used before pushing to a registry.
سؤال 30
Which command uploads an image to a registry?
docker push uploads a locally tagged image to a registry.
سؤال 31
What is a Pod in Kubernetes?
A Pod is the smallest deployable unit in Kubernetes; its containers share network and storage resources.
سؤال 32
Which object maintains a desired number of identical pods?
A ReplicaSet ensures that a specified number of pod replicas are running.
سؤال 33
Which controller manages stateless workloads with rolling updates?
Deployments manage stateless workloads and support rolling updates and rollbacks.
سؤال 34
Which controller runs one pod on every node?
DaemonSets ensure a copy of a pod runs on every eligible node, which is useful for logging and monitoring agents.
سؤال 35
Which controller runs a task to completion?
A Job creates one or more pods and tracks them until they complete successfully.
سؤال 36
Which controller runs scheduled tasks?
A CronJob creates Jobs on a schedule, similar to a cron entry.
سؤال 37
Which controller is best for stateful applications with stable network identity?
StatefulSets provide stable pod identities, ordered deployment, and persistent storage for stateful apps.
سؤال 38
What does a Kubernetes Service do?
A Service gives pods a stable virtual IP and DNS name and load balances traffic to matching pods.
سؤال 39
Which Service type exposes a service through a cloud load balancer?
LoadBalancer provisions an external load balancer and assigns the service an external IP.
سؤال 40
What is an Ingress?
Ingress exposes HTTP and HTTPS routes from outside the cluster to services inside it.
سؤال 41
What is a ConfigMap?
ConfigMaps keep configuration data separate from container images so the same image can run in different environments.
سؤال 42
What is a Secret?
Secrets store sensitive data and can be mounted into pods or passed as environment variables.
سؤال 43
Which command applies a Kubernetes manifest?
kubectl apply -f creates or updates resources declared in a YAML manifest.
سؤال 44
Which command lists pods in a cluster?
kubectl get pods lists pods and their status in the current namespace.
سؤال 45
Which command shows logs from a pod?
kubectl logs prints container logs from a pod. It is the standard Kubernetes command for troubleshooting application output. kubectl describe image is not a valid command, kubectl exec runs commands inside a container, and kubectl get events lists cluster events instead of pod logs.
سؤال 46
What is a namespace in Kubernetes?
Namespaces provide scopes for resources and help organize or isolate cluster objects.
سؤال 47
Where are CPU and memory limits for a container defined?
Container resource requests and limits are defined in the container resources field of a pod spec.
سؤال 48
What does a liveness probe check?
A liveness probe tells kubelet when a container is unhealthy and should be restarted.
سؤال 49
What does a readiness probe check?
A readiness probe determines when a pod should receive traffic from a Service.
سؤال 50
What is a PersistentVolumeClaim?
A PersistentVolumeClaim requests storage and binds to an available PersistentVolume.
سؤال 51
Which object defines how storage is provisioned in a cluster?
A StorageClass defines storage provisioners, reclaim policies, and parameters for dynamic volume provisioning.
سؤال 52
What is kubelet?
kubelet runs on each worker node and ensures containers in pods are running and healthy.
سؤال 53
Which components form the Kubernetes control plane?
The control plane includes the API server, scheduler, controller manager, and etcd.
سؤال 54
Which component stores the cluster state?
etcd is the distributed key-value store that holds the cluster state and configuration.
سؤال 55
What is a node in Kubernetes?
A node is a worker machine, physical or virtual, that runs pods through a container runtime and kubelet.
سؤال 56
What does the Horizontal Pod Autoscaler do?
The Horizontal Pod Autoscaler changes the number of pod replicas based on metrics such as CPU utilization.
سؤال 57
What does kubectl rollout status show?
kubectl rollout status reports the progress of a Deployment update until it completes or times out.
سؤال 58
What is RBAC in Kubernetes?
RBAC controls which users and service accounts can perform actions on Kubernetes API resources.
سؤال 59
What is a ServiceAccount?
ServiceAccounts provide an identity for workloads to use when talking to the API server.
سؤال 60
What does an image pull policy control?
imagePullPolicy controls whether the kubelet pulls an image always, only when absent, or never.
سؤال 61
Which of the following are Kubernetes workload controllers?
Deployment, StatefulSet, and DaemonSet are workload controllers; ConfigMap stores configuration data.
سؤال 62
Which fields commonly appear in a Service manifest?
Services use selector, ports, and type; the image field belongs to a container or pod spec.
سؤال 63
Which Docker commands manage images?
build, pull, and push manage images; docker run creates and starts a container from an image.
سؤال 64
Which of the following are valid ways to persist data in Docker?
Named volumes, bind mounts, and tmpfs mounts are storage options; overlay is a network driver.
سؤال 65
Which components are part of the Kubernetes control plane?
The API server, scheduler, and etcd are control-plane components; kubelet runs on worker nodes.
سؤال 66
Which commands help debug a failing pod?
describe, logs, and exec provide details about a pod; docker push uploads images and does not debug pods.
سؤال 67
Which probes can be defined for a container?
Kubernetes supports liveness, readiness, and startup probes; networkProbe is not a built-in probe.
سؤال 68
Which are valid Kubernetes Service types?
ClusterIP, NodePort, and LoadBalancer are Service types; Pod is a workload object, not a Service type.
سؤال 69
Type the Docker command that lists running containers.
docker ps lists running containers; docker ps -a also shows stopped containers.
سؤال 70
Type the kubectl command that applies a manifest file.
kubectl apply -f file.yaml creates or updates resources from a manifest.
سؤال 71
Type the kubectl command that shows logs for a pod named web.
kubectl logs web prints the logs from the pod named web.
سؤال 72
Type the Docker command used to run a command inside a running container.
docker exec runs a command inside a running container. It is commonly used for debugging, inspecting files, or launching an interactive shell. The answer should be docker exec because that is the Docker command for this task.
سؤال 73
Type the kubectl command that shows the status of a Deployment rollout.
kubectl rollout status deployment/name reports the progress of a rollout.
سؤال 74
Type the Kubernetes object that provides a stable network name for pods.
A Service provides a stable virtual IP and DNS name for a set of pods.
سؤال 75
Match each Docker command to what it does.
build creates images, run starts containers, push uploads images, and exec runs commands inside running containers.
سؤال 76
Match each Kubernetes object to its purpose.
Deployments manage stateless apps, StatefulSets manage stateful apps, DaemonSets run pods on every node, and CronJobs run scheduled jobs.
سؤال 77
Match each Dockerfile instruction to its purpose.
FROM sets the base, COPY adds files, CMD sets the default command, and EXPOSE documents a port.
سؤال 78
Match each Kubernetes object to its role.
ConfigMaps store config, Secrets store sensitive values, Services provide stable endpoints, and Ingress routes external HTTP traffic.
سؤال 79
Match each kubectl command to what it does.
get lists resources, describe shows details, logs prints logs, and exec runs commands in a container.
سؤال 80
Match each storage concept to its definition.
A PersistentVolume is cluster storage, a PVC requests it, a StorageClass defines provisioning, and a Volume is the pod-level mount source.