Git, Docker & testing
Version control, containers, repeatable tests and deployment diagnostics.
100 troubleshooting guides · Page 2 / 5
How can I preview untracked files before using git clean?
Git clean removes untracked files, which may include work that Git has never stored. Ignored files need even more care because they can contain local data or credentials.
Can sparse checkout reduce working-directory size without deleting repository history?
Sparse checkout limits which tracked paths populate the working tree. It does not by itself erase historical objects from the repository.
Why should generated lockfiles not be resolved by blindly choosing one side?
A lockfile represents a dependency graph tied to the manifest and package-manager behavior. Either side alone may omit changes required by the other branch.
Why should a published release tag not be moved casually?
Users and automation may already have fetched or cached the original tag target. Moving it creates inconsistent meanings for the same release name.
Do local Git hooks guarantee that every pushed commit passed checks?
Local hooks depend on each checkout’s configuration and can be bypassed or absent. They improve feedback but are not an enforceable server-side quality boundary.
Can Git reuse a previous conflict resolution safely?
Rerere records how a conflict was resolved and can reuse that resolution when a similar conflict appears. This reduces repetitive editing but does not understand current business intent.
Why can a container not reach another container through localhost?
Localhost inside a container refers to that container’s own network namespace, not every service on the host. The target may be listening elsewhere.
Why does EXPOSE not make a container port reachable from my browser?
EXPOSE documents a container port; it does not itself publish that port on the host. The application also must listen on an address reachable within the container.
Why does depends_on not always mean the database is ready for queries?
Starting a container and having a usable database are different states. Basic startup ordering may only establish that the dependency process has started.
Why do files installed in an image disappear when I add a bind mount?
A mount placed over a nonempty container directory obscures the image’s original contents at that path. The files are not necessarily deleted from the image.
Why did database data disappear after recreating a container?
Data written only to the container’s writable layer is tied to that container. Recreating it does not automatically preserve application state.
Why does a non-root container get permission denied on a mounted directory?
Filesystem permissions depend on numeric user/group identities and mount behavior, not matching user names shown inside and outside the container.
Why does Docker rebuild dependencies after every source-code edit?
A dependency-install layer is invalidated when an earlier copied input changes. Copying the whole source tree before installing dependencies makes unrelated edits part of that cache key.
Why is Docker sending a huge build context before the build starts?
The build context may include dependencies, generated output, archives and other files the Dockerfile never needs. Transferring them wastes time and can expose unwanted material to the builder.
How do multi-stage builds reduce a production image without losing required files?
Build tools and intermediate artifacts do not always need to ship with the runtime. Separate stages let the final image copy only the required output.
Why should a registry token not be passed through Docker ARG?
Build arguments and environment instructions are not designed as secret storage. Values can leak through image metadata, history or build output depending on use.
Why can pulling the same image tag produce different code later?
A tag is a movable name, not an immutable content identifier. Publishers can point the same tag to another image.
Why does a container fail with exec format error on another machine?
The executable or image may target a different CPU architecture, or an entry script may have an invalid interpreter format. The message alone does not distinguish them.
Why does a container ignore termination until it is forcibly killed?
The application may not receive the signal because a shell wrapper remains PID 1 or does not forward signals as intended. The app may also lack shutdown handling.
Will a Docker health check automatically restart an unhealthy container?
A health check reports status; a basic restart policy reacts to container exit behavior, not every unhealthy status by itself. An orchestrator may add separate handling.
Does container exit code 137 always prove an out-of-memory kill?
Exit code 137 commonly corresponds to termination by SIGKILL, but that signal can have more than one cause. It is not sufficient proof of memory exhaustion by itself.
How can container logs fill a disk even when the application writes no files?
The container runtime stores stdout/stderr through its logging driver. An unbounded log stream can therefore consume host storage outside the application directory.
How do I identify Docker disk usage before pruning anything?
Images, build cache, stopped containers and volumes hold different kinds of data. Treating all unused objects as disposable can delete a recoverable database or important build artifact.
Why does a Compose environment variable have a different value than my .env file?
Compose interpolation and the environment delivered inside a container are related but distinct, with precedence rules involving shell variables and configuration.
Ask your own question · Sign in to post questions and answers.