Skip to content

Commit b50db6c

Browse files
cliffhallclaude
andcommitted
docs(memory): give Docker upgrade steps that keep the container working
The old note told users to delete the volume's index.js, which leaves /app/dist with no entry point: the claude-memory volume is mounted over /app/dist and a non-empty named volume is never re-seeded from a newer image. Replace it with a command that swaps the volume's *.js files for the new image's while keeping memory.jsonl, and describe the alternative of a data-only volume with MEMORY_FILE_PATH, including how to move an existing graph into it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 281b167 commit b50db6c

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

‎src/memory/README.md‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,42 @@ Docker:
381381
docker build -t mcp/memory -f src/memory/Dockerfile .
382382
```
383383

384-
For Awareness: a prior mcp/memory volume contains an index.js file that could be overwritten by the new container. If you are using a docker volume for storage, delete the old docker volume's `index.js` file before starting the new container.
384+
### Upgrading a Docker install
385+
386+
The [Docker](#docker) setup mounts the named volume `claude-memory` over `/app/dist`, the image's code directory, so the volume holds the server's code (`index.js`, `version.js`) next to your `memory.jsonl`. Docker copies an image's files into a named volume only while the volume is empty. Once the volume holds your graph, a newer image never reaches it: the container keeps running the code from the image that first filled the volume, which may not even start against the newer image's dependencies. Deleting `index.js` from the volume does not help; it leaves `/app/dist` with no entry point.
387+
388+
To upgrade, build or pull the new `mcp/memory` image, quit the MCP clients that start it, then replace the code in the volume with the new image's, keeping `memory.jsonl`:
389+
390+
```sh
391+
docker run --rm -v claude-memory:/volume --entrypoint sh mcp/memory \
392+
-c 'rm -f /volume/*.js && cp /app/dist/*.js /volume/'
393+
```
394+
395+
The volume is mounted at `/volume` rather than `/app/dist`, so the image's own `/app/dist` stays visible to copy from. Only the `.js` files are replaced; `memory.jsonl` (or a legacy `memory.json`) is left as it is. Repeat this after every image update.
396+
397+
#### Alternative: keep the graph in a volume of its own
398+
399+
Mounting a volume on a directory of its own and pointing `MEMORY_FILE_PATH` at it keeps the code out of the volume, so a new image takes effect with no copying step:
400+
401+
```json
402+
{
403+
"mcpServers": {
404+
"memory": {
405+
"command": "docker",
406+
"args": ["run", "-i", "-v", "claude-memory-data:/data", "-e", "MEMORY_FILE_PATH=/data/memory.jsonl", "--rm", "mcp/memory"]
407+
}
408+
}
409+
}
410+
```
411+
412+
To move an existing graph from the `claude-memory` volume into the new one, quit the MCP clients that start the server, then run:
413+
414+
```sh
415+
docker run --rm -v claude-memory:/old -v claude-memory-data:/data \
416+
--entrypoint cp mcp/memory /old/memory.jsonl /data/memory.jsonl
417+
```
418+
419+
If the old volume holds only a legacy `memory.json`, copy `/old/memory.json` to `/data/memory.jsonl` instead. Once the server has started on the new volume with your graph, you can remove the old volume with `docker volume rm claude-memory`.
385420

386421
## License
387422

0 commit comments

Comments
 (0)