Uninstall DeepSeek Harness in containers: DSH plugin cache
Uninstalling DeepSeek Harness in containers is inherently more involved than on a host, because the default is "program follows the container, data stays on the volume." Deleting the container clears only the writable layer; the volume still holds profiles, installed DSH plugin records, sessions and credentials. And even after deleting both container and volume, image layers and build cache still occupy disk — three independent things, and many people stop after the first. State your goal first: delete container plus volume plus image and build cache for a complete removal, or delete only the container to keep data.
How DeepSeek Harness container uninstall differs from the host
Bottom line: a host uninstall is "remove program plus decide on data." A container uninstall adds image layers.
| Dimension | Host uninstall | Container uninstall |
|---|---|---|
| Program | Uninstall command or delete install directory | Delete the container (writable layer gone) |
| Data | Decide manually about the data directory | Kept on the volume by default; delete it explicitly |
| Extra residue | Cache directories | Image layers plus build cache |
| Effect on other environments | None | Other containers sharing the image are unaffected, but the image still occupies space |
Option A: drop and rebuild (cleanest)
Bottom line: do not clean, rebuild. Delete the container and the volumes you no longer need, then start fresh from the image.
- Decide whether data must be kept — this drives the next steps:
docker volume ls | grep dsh # list DeepSeek Harness related volumes
# expected: your data volume names; delete them below if you do not want them
- Stop and remove the container:
docker rm -f dsh
- Remove the volume if appropriate — this is what actually makes data disappear:
docker volume rm dsh-data # data volume: deleting it removes sessions and plugin records
- Rebuild as before (see installing DeepSeek Harness in Docker).
- Verify: check dsh plugin in the new container. Empty means the data really is gone; present means the volume survived.
Option B: targeted in-container cleanup (keep the container)
Bottom line: when keeping the container, clean plugins, then caches, then indexes. Never touch configuration or credentials.
- Record the list first in case you need to restore:
dsh plugin # note what is installed before removing
- Remove plugins with the uninstall or remove subcommand (confirm with dsh plugin --help).
- Clear caches and indexes — rebuildable data only, never the whole data directory.
- Confirm the effect:
du -sh "$DSH_HOME"/* 2>/dev/null | sort -h | tail -5
# expected: the largest subdirectories shrink after cleanup
- Verify: reinstall one plugin and run it once to confirm the environment still works.
Option C: slim the DeepSeek Harness image at build time
Bottom line: image size can only be reduced at build time. Files deleted at runtime are already in a layer and do not shrink the image.
- Multi-stage builds: install and compile in a build stage; copy only artifacts into the runtime stage.
- Install, use and clean in one layer: combine those into a single RUN so caches never persist in an intermediate layer.
- Pick a smaller base image — but remember that slim and Alpine images often fail with native-module plugins (see the Docker install guide).
- Prune build cache — frequently forgotten:
docker builder prune
# expected: reclaims build cache space; confirm no build is in progress
- Verify: compare docker images sizes and run the functionality once to confirm nothing needed was removed.
Handling three DeepSeek Harness volumes
Bottom line: the data volume decides whether sessions survive, the workspace volume decides whether your files survive, and the cache volume is safe to delete.
| Volume | Contents | How to handle it |
|---|---|---|
| Data (DSH_HOME) | Profiles, installed DSH plugin records, sessions, credentials | Careful: unrecoverable if deleted; keep it to rebuild the container |
| Workspace | Project files you process | Never delete casually — this is your business data |
| Cache (packages, indexes) | Rebuildable intermediates | Safe to delete; the only cost is slower next run |
- Name volumes by purpose (dsh-data, proj-data, dsh-cache) so cleanup cannot delete the wrong one.
- List before cleaning and confirm ownership of each volume.
- Back up rather than delete: back up the data volume first (see DeepSeek Harness on disk).
Three CI cleanup steps for DeepSeek Harness
Bottom line: CI cleanliness comes from no persistent volume, temporary containers, and explicit cache clearing. The first matters most.
- Point the data directory inside the container (no volume mount), so data vanishes with the container.
- Run temporary containers (--rm) to avoid accumulating stopped containers.
- Clear local caches and temp directories at the end of the job.
docker run --rm -e DSH_HOME=/tmp/dsh -v "$PWD:/workspace" dsh-local:0.2.0-rc.2 dsh --version
# expected: the container is destroyed on exit, leaving no trace under /tmp/dsh
- Verify: check volume lists and disk usage on the runner after a run to confirm nothing accumulates.
DSH plugin troubleshooting for container cleanup
Bottom line: decide what you deleted — container, volume and image layer are three things. No single action produces all three effects.
- Data still there — the volume remains; deleting containers does not delete volumes.
- Disk not freed — images and build cache remain; neither is reclaimed by container or volume deletion.
- Data lost by mistake — check whether you deleted the data or workspace volume; restore from backup or start over.
- CI growing over time — either the data directory is on a persistent volume or build cache is never pruned.
- Plugins still present after reinstalling — the data volume was preserved. Sometimes that is desired; confirm your goal.
- Repair status, stated honestly: this follows Docker's container, volume and layer semantics plus the official CLI data directory notes. Containerized DeepSeek Harness has no dedicated official guide, so confirm volume and cache names against your own layout.
For host-side (non-container) uninstall and residue cleanup, see dsh uninstall and data cleanup.
Sources: apps/cli/README.md, Docker Docs · volumes, Docker Docs · build cache.
FAQ
In DeepSeek Harness, deleting a container clears only its writable layer. DeepSeek Harness data on mounted volumes — profiles, installed DSH plugin records, sessions and credentials — survives by design. Cleaning up properly means two decisions: remove the container, and decide whether to remove the data volume. Removing only the container uninstalls the program and keeps the data.
In DeepSeek Harness, because image layers are not reclaimed by deleting containers. The image itself occupies space, and intermediate layers from builds remain in the local build cache. Freeing that space is a separate action: remove unused image tags and prune the build cache. Container, volume and image cleanup are three independent operations.
In DeepSeek Harness, use temporary containers that are removed on exit, point the data directory at a temporary path inside the container instead of a mounted volume, and explicitly clear local caches and temp directories at the end of the job. The critical one is not mounting a persistent volume: without it, data disappears with the container and needs no extra cleanup.
DeepSeek Harness image size must be reduced at build time, not at runtime. Separate dependency installation, build output and runtime content into stages and copy only artifacts into the runtime stage; within a stage, install, use and clean in the same layer. Deleting files at runtime does not shrink an image because they are already recorded in a layer — the most common misunderstanding.
In DeepSeek Harness, yes, if the data lives on a volume: deleting the container leaves the volume intact, and a rebuilt container mounted to the same volume still has sessions and the plugin list. This is the recommended container pattern — program in the container, data on the volume — so upgrades and cleanup never affect data.
Related Terms
- container writable layer
- The writable layer holds files created while a container runs and disappears when the container is deleted. It contains only runtime changes, not mounted volume contents, which is why deleting a container is not deleting data.— https://docs.docker.com/storage/volumes/
- data volume
- A data volume is persistent storage independent of the container lifecycle. DeepSeek Harness data usually lives on a volume, so whether an uninstall is complete depends on whether you deleted that volume.— https://docs.docker.com/storage/volumes/
- image layer
- An image layer is one component of a container image recording a set of file changes. Deleting containers does not reclaim layer space; you must remove image tags and prune build cache.— https://docs.docker.com/build/cache/
- build cache
- Build cache holds intermediate results reused across image builds to speed them up. It occupies disk long-term and is frequently overlooked when reclaiming space.— https://docs.docker.com/build/cache/