Commit b38615d
authored
docker container cleanup (#689)
## Problem
When working with git worktrees or multiple clones of the repository on
the same machine, the CouchDB Docker container setup can cause
conflicts. This happens because:
1. Multiple worktrees try to use the same container name
(`skuilder-test-couch`)
2. Docker attempts to mount volumes to paths that may already exist in
other containers
3. This results in errors like:
```
Error response from daemon: failed to create task for container:
failed to create shim task: OCI runtime create failed: runc create
failed: unable to start container process: error during container init:
error mounting "/path/to/local.ini" to rootfs at
"/opt/couchdb/etc/local.ini"
```
## Solution
Automatic cleanup process in the `dev-couchdb.js` script that runs
before starting CouchDB. This process:
1. Checks if a container with the name `skuilder-test-couch` already
exists
2. If it exists:
- Stops the container if it's running
- Removes the container
3. Continues with the normal start process using the test-couch.sh
script
This ensures that each time you start CouchDB, you get a fresh container
without conflicts from previous runs or other worktrees.2 files changed
+94
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
47 | 87 | | |
48 | 88 | | |
49 | | - | |
| 89 | + | |
| 90 | + | |
50 | 91 | | |
51 | 92 | | |
52 | 93 | | |
| |||
55 | 96 | | |
56 | 97 | | |
57 | 98 | | |
| 99 | + | |
58 | 100 | | |
59 | 101 | | |
60 | 102 | | |
| |||
0 commit comments