Skip to content

Commit 8ba151c

Browse files
committed
feat: verify that volumes are empty
This can cause problems in some setups and should not be needed as the container expects these to be empty. See WeblateOrg/docker#2816
1 parent e9746e0 commit 8ba151c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/dockerimage.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
- name: Test content
16+
run: ./test-content
1517
- name: Generate configuration
1618
run: ./test-generate 8080 http
1719
- name: Startup container

test-content

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
STORAGE=$(mktemp)
4+
cleanup(){
5+
rm "$STORAGE"
6+
}
7+
trap cleanup EXIT
8+
9+
echo "Creating container..."
10+
docker create --name="tmp_$$" "${TEST_CONTAINER:-weblate/weblate:edge}"
11+
echo "Listing content container..."
12+
docker export tmp_$$ | tar t > "$STORAGE"
13+
echo "Removing container..."
14+
docker rm tmp_$$
15+
echo "Checking content..."
16+
17+
# /app/data is not checked because it contains stub for customization
18+
if grep -E '^(app/cache|tmp|run)/.+' "$STORAGE" ; then
19+
echo "Volumes contain files!"
20+
exit 1
21+
fi
22+
23+
echo "$STORAGE"

0 commit comments

Comments
 (0)