Docker Engineer Interview Questions: Ops and Security (2027)

42 Docker engineer interview questions on daemon.json, logging, live restore, rootless mode, Engine 29, BuildKit secrets, attestations and incidents.

Sep 10, 2025 - 12:53
Nov 6, 2026 - 09:53
 0  63
Docker Engineer Interview Questions: Ops and Security (2027)

Docker engineer interviews focus on running the Docker Engine in production: configuring the daemon through daemon.json, choosing logging and storage settings, hardening containers with rootless mode, capabilities and seccomp, building signed and scanned images with BuildKit, and debugging hosts when containers crash, leak disk or lose network access. This page has 42 questions for that role.

It is written for people interviewing for a platform, infrastructure or "Docker engineer" title, where the job is to keep the engine and the hosts healthy rather than only to write a Dockerfile. If you need the basics first, start with our 100+ Docker interview questions on core concepts. For a larger bank of incident questions, the main page in this series is 100+ Docker scenario-based interview questions. Answers were checked against docs.docker.com in November 2026, when the current major release was Docker Engine 29.

Key takeaways

  • Know the daemon configuration file by heart: /etc/docker/daemon.json on Linux, and the keys you set most often (log-driver, log-opts, live-restore, default-address-pools, registry-mirrors).
  • The default logging driver, json-file, does not rotate logs. Docker recommends the local driver or explicit max-size and max-file options.
  • Docker Engine 29 makes the containerd image store the default on fresh installs, deprecates cgroup v1 and removes Docker Content Trust from the CLI. Interviewers who track releases will ask about these.
  • Rootless mode runs the daemon and containers as a normal user. userns-remap also uses user namespaces, but the daemon still runs as root.
  • Supply chain questions now expect BuildKit attestations (--sbom, --provenance) and a scanner such as docker scout cves wired into CI.

What a Docker engineer interview covers

Most Docker question banks test whether you can write a Dockerfile and run Compose. A Docker engineer role adds the layer underneath: the daemon, the host kernel features it relies on, the registry, and the policies that keep many teams' containers from hurting each other. The table shows how the questions on this page map to that work.

AreaWhat you are expected to knowQuestions
Engine and daemondockerd, containerd, runc, daemon.json, live restore, contexts1-8, 13-16
Logging and storageLogging drivers, rotation, overlay2, disk cleanup9-12, 17-20
NetworkingBridge networks, address pools, DNS, published ports21-23
SecurityRootless mode, user namespaces, capabilities, seccomp, socket exposure24-30
Supply chainBuildKit secrets, attestations, scanning, registry policy31-34
IncidentsCrashes, OOM kills, full disks, slow pulls, daemon upgrades35-42

Questions for freshers

1. What are dockerd, containerd and runc, and how do they relate?

dockerd is the Docker daemon that serves the Docker API. It hands container lifecycle work to containerd, which manages images, snapshots and running containers. containerd starts each container through an OCI runtime, by default runc, which sets up the namespaces and cgroups and then exits. If an interviewer asks why Kubernetes can run without Docker, this split is the answer: Kubernetes talks to containerd through the CRI and skips dockerd entirely.

2. Where is the daemon configuration file and what format does it use?

On Linux it is /etc/docker/daemon.json, a JSON file read when dockerd starts. In rootless mode the file is ~/.config/docker/daemon.json. The same settings can be passed as dockerd flags, but setting one option in both places makes the daemon refuse to start, so pick one.

3. How do you apply a change to daemon.json?

Restart the daemon, for example sudo systemctl restart docker. Some options can be reloaded with a SIGHUP (systemctl reload docker), and the Docker docs say live restore can be enabled that way without downtime. Always validate the JSON first. A missing comma stops the daemon from starting, which on a single host means every container stops too.

4. What does docker info tell you?

It prints the server version, storage driver, logging driver, cgroup driver and version, number of containers and images, registry mirrors, and any warnings such as missing kernel features. It is the first command to run on an unfamiliar host because it shows how the daemon is actually configured, which may differ from what the documentation for that server says.

5. What restart policies does Docker support?

no (default), on-failure[:max-retries], always and unless-stopped. The difference between the last two matters after a reboot: always starts the container again even if you stopped it by hand, while unless-stopped leaves a manually stopped container down.

docker run -d --restart unless-stopped --name api myorg/api:1.4.2

6. What is a HEALTHCHECK and how does Docker use it?

A HEALTHCHECK instruction (or the --health-cmd flag) runs a command inside the container on an interval. Docker marks the container healthy or unhealthy in docker ps and docker inspect. Plain Docker does not restart an unhealthy container by itself. Swarm replaces unhealthy tasks, and Compose can wait for a healthy dependency with depends_on and condition: service_healthy.

7. How do you limit a container's memory and CPU?

Use --memory (for example --memory 512m) and --cpus (for example --cpus 1.5). Add --pids-limit to stop fork bombs. Without limits, one container can starve the rest of the host, and the kernel OOM killer may pick a process you care about.

docker run -d --memory 512m --cpus 1.5 --pids-limit 200 myorg/worker:2.0.1

8. What is a Docker context?

A context stores the endpoint and TLS settings for a Docker daemon, so one CLI can manage several hosts. docker context create prod --docker "host=ssh://ops@prod-01" creates one, and docker context use prod switches to it. It is safer than exporting DOCKER_HOST in a shell and forgetting it is set.

9. What is the default logging driver and what is its main risk?

The default is json-file. Docker's logging docs state that it performs no log rotation by default, so a chatty container can fill the disk under /var/lib/docker/containers. Set max-size and max-file, or switch to the local driver, which rotates by default and uses a more compact format.

10. How do you set log rotation for all new containers?

Set it in daemon.json. Values under log-opts must be strings, including numbers.

{
  "log-driver": "local",
  "log-opts": {
    "max-size": "20m",
    "max-file": "5"
  }
}

The change applies only to containers created after the restart. Existing containers keep their old logging settings until they are recreated.

11. What storage driver does Docker use on most Linux hosts?

overlay2. It stacks read-only image layers under a thin writable layer per container. Writes to large files inside the container trigger a copy-up of the whole file into that writable layer, which is why databases and other write-heavy paths belong on volumes.

12. How do you see what is using Docker disk space?

docker system df summarises images, containers, local volumes and build cache, and docker system df -v breaks them down. docker builder prune clears build cache, and docker image prune -a removes images not used by any container. Do not run docker volume prune on a host where you have not checked which volumes hold data.

Questions for 2 to 5 years of experience

13. What does live restore do and what are its limits?

With "live-restore": true in daemon.json, containers keep running while dockerd is stopped or restarted. Docker's docs list the limits: it works for patch upgrades (YY.MM.x) but not major daemon upgrades, it applies only to standalone containers and not Swarm services, it is not supported for Windows containers, and containers may not reconnect if you changed options such as the bridge IP or storage driver in the same restart.

14. What changed in Docker Engine 29 that affects operations?

The Engine 29 release notes say the containerd image store is the default for fresh installs (not for daemons using userns-remap), cgroup v1 is deprecated with support continuing until at least May 2029, and Docker Content Trust was removed from the Docker CLI in 29.0.0. Legacy link environment variables are no longer added automatically. A good answer adds that you read the release notes for every minor version before upgrading a fleet.

15. Why does the containerd image store matter?

It lets the engine store multi-platform images and attestations natively. Docker's attestation docs say that building attestations with the default docker build driver requires the containerd image store. On upgraded hosts that still use the classic store, you either switch, use another buildx driver such as docker-container, or turn attestations off.

16. How do you inspect why a container exited?

Check docker ps -a for the exit code, then docker inspect for State.ExitCode, State.OOMKilled and State.Error. Read the last lines with docker logs --tail 100. Exit code 137 means SIGKILL, often from the OOM killer or a docker kill. Exit code 143 is SIGTERM, which is normal on a clean stop.

docker inspect --format '{{.State.ExitCode}} {{.State.OOMKilled}}' api

17. What is non-blocking log delivery and when do you use it?

By default, a container writes to the logging driver in blocking mode, so the application waits if the driver is slow. With "mode": "non-blocking" in log-opts, messages go into a ring buffer (default max-buffer-size of 1 MB) and new messages are dropped if it fills. Use it for remote drivers where a slow log endpoint should not stall the application, and accept that you can lose lines under pressure.

18. How would you ship container logs to a central system?

Two common designs. Keep a local driver (json-file or local) and run an agent such as Fluent Bit or Filebeat that tails the files, or use a remote driver such as fluentd, gelf, syslog or awslogs. The agent design survives a log backend outage better, and it keeps docker logs working. Our ELK monitoring interview questions cover the receiving side.

19. Why put database data on a volume rather than in the container layer?

The writable layer is deleted with the container, and copy-up on overlay2 makes write-heavy workloads slow. A named volume lives under Docker's control outside the container lifecycle and performs like the host filesystem. Bind mounts work too but tie the container to a host path and its permissions.

20. How do you stop build cache from filling CI runners?

Run docker builder prune with a filter such as --filter until=72h on a schedule, or configure BuildKit garbage collection limits in the builder config. For shared caches, export the cache to a registry with --cache-to type=registry and import it with --cache-from, so runners can be thrown away. More options are in 12 ways to speed up Docker builds in CI/CD.

21. A new bridge network conflicts with a corporate subnet. How do you prevent it?

Set default-address-pools in daemon.json so Docker allocates networks from ranges you control, and pass --subnet when creating important networks. Docker picks private ranges automatically, which can collide with VPN or office networks and make internal services unreachable from containers.

{
  "default-address-pools": [
    { "base": "10.200.0.0/16", "size": 24 }
  ]
}

22. Why can containers on the default bridge not reach each other by name?

Docker's embedded DNS works on user-defined networks, not on the default bridge. Create a network with docker network create app-net and attach containers to it. The old --link option is legacy, and Engine 29.6.0 started warning when links are used on the default bridge.

23. What is the difference between publishing on 0.0.0.0 and 127.0.0.1?

-p 8080:80 listens on all host interfaces by default. -p 127.0.0.1:8080:80 listens only locally, which is what you want for admin ports behind a reverse proxy. Docker inserts its own firewall rules for published ports, and its docs warn that ufw does not filter that traffic, so control exposure with the bind address or rules in the DOCKER-USER chain.

24. What does --cap-drop ALL do?

It removes all Linux capabilities from the container's root user. You then add back only what the process needs, for example --cap-add NET_BIND_SERVICE to bind to port 80. Most web applications need no added capabilities if they listen on a high port.

25. What other run-time hardening flags do you use?

--read-only with a --tmpfs /tmp for scratch space, --security-opt no-new-privileges to block setuid escalation, --user 10001:10001 to avoid root, and resource limits. Keep Docker's default seccomp profile enabled; --security-opt seccomp=unconfined should need a written reason. Our container hardening rules go through each one.

26. Why is mounting /var/run/docker.sock into a container risky?

Access to the socket is full control of the daemon, and the daemon runs as root in standard installs. A process that can talk to it can start a privileged container that mounts the host filesystem. If a tool needs it, prefer a socket proxy that allows only the API calls it needs, or a rootless daemon.

Senior questions

27. Compare rootless mode with userns-remap.

Both use user namespaces so that root inside the container maps to an unprivileged host UID. With userns-remap, the daemon itself still runs as root. In rootless mode, set up with dockerd-rootless-setuptool.sh install, both the daemon and containers run as a normal user, so a daemon bug does not hand over host root. Rootless needs newuidmap and newgidmap and at least 65,536 subordinate IDs in /etc/subuid and /etc/subgid. Expect differences in networking and in some storage and cgroup features, so test the workload before switching.

28. Who should be in the docker group?

Treat it like sudo. Membership allows talking to the root daemon without a password, which is equivalent to root on the host. On shared build hosts, give people a rootless daemon or a CI system that runs builds for them instead.

29. How do you plan a Docker Engine upgrade across a fleet?

Read the release notes for deprecations, test the new version on a canary host with real workloads, and upgrade in batches behind a load balancer. Remember that live restore does not cover major upgrades, so drain hosts first. Pin the package version in your configuration management so hosts do not upgrade themselves on the next apt upgrade.

30. How do you handle the cgroup v1 deprecation?

Check docker info for the cgroup version on every host. Move older distributions to releases that boot with cgroup v2 by default, and test applications that read cgroup files directly, such as older JVMs and monitoring agents, because the file layout changed. Docker's notes give support until at least May 2029, which leaves time to plan rather than rush.

31. How do you pass a secret to a build without leaving it in a layer?

Use a BuildKit secret mount. The secret is available only during that RUN step and is not written to the image.

# syntax=docker/dockerfile:1
FROM python:3.13-slim
RUN --mount=type=secret,id=pip_token \
    PIP_INDEX_URL="https://__token__:$(cat /run/secrets/pip_token)@pypi.example.com/simple" \
    pip install --no-cache-dir -r requirements.txt
docker buildx build --secret id=pip_token,src=./pip_token.txt -t myorg/app:1.0.0 .

ARG and ENV values end up in image history, so they are the wrong place for credentials.

32. What are SBOM and provenance attestations in Docker builds?

An SBOM attestation lists the packages in the image. A provenance attestation records how it was built: the builder, source, and build arguments. Docker adds mode=min provenance by default. Use --sbom=true and --provenance=mode=max to add more, and push them to the registry with the image so scanners and admission policies can read them.

33. How do you add vulnerability scanning to the pipeline?

Scan the built image and fail on severities you have agreed with the security team. With Docker Scout:

docker scout cves --only-severity critical,high --exit-code myorg/app:1.0.0

The command returns exit code 2 when it finds matching vulnerabilities, which fails the CI job. Trivy and Grype are common alternatives. Scanning in CI is not enough on its own, because new CVEs appear after release, so rescan images that are running in production on a schedule.

34. Docker Content Trust is gone from the CLI. How do you sign images now?

Since Engine 29.0.0 removed it, teams sign with tools built on OCI artifacts, most often Sigstore cosign or Notation, and enforce verification at deploy time with an admission controller or registry policy. In an interview, say which signer your last team used and where verification happened, because signing without verification gives no protection.

Scenario questions

35. A host's disk is 100% full and containers are failing. What do you do?

Find the largest consumer first: docker system df, then du -sh /var/lib/docker/*. Unrotated json-file logs under /var/lib/docker/containers are the usual cause. Truncate the biggest log file for immediate relief, then fix the logging config and recreate the container. Clear build cache and dangling images next. Finally, add a disk usage alert so it does not reach 100% again.

36. A container keeps restarting with exit code 137.

Check State.OOMKilled in docker inspect and the kernel log (dmesg or journalctl -k) for OOM messages. If the container hit its own memory limit, either the limit is too low or the application leaks. Watch docker stats while it runs. If OOMKilled is false, look for something else sending SIGKILL, such as an orchestrator stopping it after a failed health check.

37. After a daemon restart, all containers went down even with live restore set.

Check whether the restart was a major version upgrade, whether the containers are Swarm services, and whether daemon options such as the storage driver or bridge IP changed in the same restart. Any of these stops live restore from reconnecting. Also confirm the setting loaded: docker info shows Live Restore Enabled: true when it is active.

38. Image pulls are slow and sometimes hit rate limits.

Configure a pull-through cache and point the daemon at it with registry-mirrors in daemon.json, authenticate pulls so you get your account's limits, and copy base images you depend on into your own registry. For registry options, see Docker Hub alternatives.

39. A container cannot resolve internal hostnames, but the host can.

Run docker exec into it and read /etc/resolv.conf. Containers on user-defined networks use Docker's embedded DNS at 127.0.0.11, which forwards external lookups to the DNS servers configured on the host. Containers on the default bridge get a copy of the host's resolv.conf instead, and a loopback address copied from the host means nothing inside the container's own network namespace. Compare what the container sees with what the host uses, test with nslookup from inside the container, and set the dns key in daemon.json, or --dns per container, to your internal DNS servers if the forwarding path is wrong.

40. A security review finds containers running as root with the socket mounted.

List them with docker ps and docker inspect filters, then rank by exposure. Remove the socket mount or put a filtering proxy in front of it, rebuild images with a non-root USER, add --cap-drop ALL and no-new-privileges, and add a CI or policy check so new services cannot ship the same way. Report what you fixed and what still needs an exception.

41. A published port is reachable from the internet even though the firewall blocks it.

Docker's docs state that Docker and ufw are incompatible: published-port traffic is routed in the nat table before ufw's INPUT rules see it, so ufw's default deny does not apply. Bind the port to 127.0.0.1 or a private interface, or add rules in the DOCKER-USER chain, which Docker leaves for administrators. Then scan from outside to confirm the port is closed.

42. Builds that used to produce attestations now fail on new hosts.

Check the image store and the build driver. With the default docker driver, attestations need the containerd image store, which is default only on fresh Engine 29 installs. Older hosts upgraded in place may still use the classic store. Either enable the containerd image store, use a docker-container builder, or disable attestations on those builders until they are migrated.

How to prepare

Install Docker Engine in a Linux VM and break it on purpose: fill the disk with logs, set a bad daemon.json, cap memory until a container is OOM killed, and switch to rootless mode. Being able to describe what you saw is worth more than memorised definitions. Then practise the Dockerfile and Compose side with advanced Docker interview questions and the CI-focused Docker CI/CD pipeline interview questions. If you want guided labs, our Docker training in Pune runs in the Kharadi classroom and live online.

FAQ

What does a Docker engineer do?

A Docker engineer runs the container platform: installing and upgrading Docker Engine, setting daemon policy for logging, storage and networking, hardening hosts and containers, running registries and build infrastructure, and fixing incidents when containers or hosts misbehave.

Which daemon.json settings should I know for interviews?

Know log-driver and log-opts, live-restore, default-address-pools, registry-mirrors, dns, storage-driver and userns-remap. Be able to say what each does and that log-opts values must be strings.

Is Docker Content Trust still used?

Docker Content Trust was removed from the Docker CLI in Engine 29.0.0. Teams now sign images with tools such as Sigstore cosign or Notation and verify signatures at deploy time.

Should production hosts use rootless Docker?

Rootless mode reduces the damage from a daemon or runtime vulnerability because nothing runs as host root. Test networking and storage behaviour for your workloads first, since some features behave differently.

How is this different from general Docker interview questions?

General question banks focus on images, Dockerfiles and Compose. Docker engineer questions focus on the engine, hosts, security policy and incidents, which is what platform and infrastructure roles are hired to handle.

What is the most common Docker production incident?

A full disk, usually caused by json-file logs without rotation, old images and build cache. Configure rotation in daemon.json, prune on a schedule and alert on disk usage.

Official references

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.