Skip to content

Docker Compose backup and restore example: fix path - #2160

Merged
marcleblanc2 merged 2 commits into
mainfrom
marc/compose-restore-into-volumes
Nov 13, 2026
Merged

marcleblanc2 merged 2 commits into
mainfrom
marc/compose-restore-into-volumes

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • The Docker Compose restore command examples copy the dumps to /tmp in the database containers, which is now read-only

Solution

  • Copy the dumps to a writable path, the database volume, like the Kubernetes restore does
  • Delete them after the restore

Test plan

  • Ran every backup and restore step as written, on Docker Compose with Sourcegraph 8.2.0, with and without deploy-sourcegraph-docker#1470 (orb test)
    • Every command exited 0
    • Data written before the backup is back, data written after it is gone
    • No dump files left in the containers
    • Sourcegraph starts and is healthy
  • Control: the old /tmp copy with deploy-sourcegraph-docker#1470 fails with container rootfs is marked read-only

The restore copied the dumps into /tmp in each database container. With a
read-only root filesystem, /tmp is not writable and docker cp refuses the
copy. Copy them into the database volumes instead, as the Kubernetes
restore does, and delete them after the restore.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d36e-7d38-77c8-98dc-e4678a3ad2b0
Co-authored-by: Amp <amp@ampcode.com>
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Nov 13, 2026 6:20am UTC

Request Review

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor
Page Before After Diff
/self-hosted/deploy/docker-compose/operations prod preview −9 +21

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ This PR edits 1 passage pair(s) that were already duplicated

The passage you changed is also written somewhere else, so the two copies now disagree. Decide which page is the home for it, and replace the other copy with a link; or make the same change there too.

2 passages, at least 76% similar

Reproduce locally with node dev/check-duplicates.mjs --diff <(git diff -U0 origin/main).

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@marcleblanc2 marcleblanc2 changed the title Copy Docker Compose restore files into the database volumes Docker Compose restore: copy dumps to a writable path Nov 13, 2026
@marcleblanc2
marcleblanc2 marked this pull request as ready for review November 13, 2026 06:30
@marcleblanc2
marcleblanc2 requested a review from a team November 13, 2026 06:32
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) November 13, 2026 06:32
@marcleblanc2 marcleblanc2 changed the title Docker Compose restore: copy dumps to a writable path Docker Compose backup and restore example: fix path Nov 13, 2026
@marcleblanc2
marcleblanc2 merged commit b1a7626 into main Nov 13, 2026
20 of 21 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/compose-restore-into-volumes branch November 13, 2026 06:36

This branch was successfully deployed

1 active deployment
Preview — 9c915142 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants