mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-19 07:22:39 +02:00
Allow backup to be run as non-root user (#366)
* Allow backup to be run as non-root user * Document usage as non-root user * Also test /etc access * Choose better name for doc
This commit is contained in:
27
test/nonroot/run.sh
Executable file
27
test/nonroot/run.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
. ../util.sh
|
||||
current_test=$(basename $(pwd))
|
||||
|
||||
export LOCAL_DIR=$(mktemp -d)
|
||||
|
||||
docker compose up -d --quiet-pull
|
||||
sleep 5
|
||||
|
||||
docker compose logs backup
|
||||
|
||||
# conf.d is used to confirm /etc files are also accessible for non-root users
|
||||
docker compose exec backup /bin/sh -c 'set -a; source /etc/dockervolumebackup/conf.d/01conf.env; set +a && backup'
|
||||
|
||||
sleep 5
|
||||
|
||||
expect_running_containers "3"
|
||||
|
||||
if [ ! -f "$LOCAL_DIR/backup/test.tar.gz" ]; then
|
||||
fail "Could not find archive."
|
||||
fi
|
||||
pass "Archive was created."
|
||||
|
||||
Reference in New Issue
Block a user