Test docker image, basic functionality
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Check if we are running as root (default)
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
# If /data is a directory, change its ownership to the container user
|
||||
if [ -d "/data" ]; then
|
||||
echo "Setting ownership of /data to appuser:appgroup"
|
||||
chown -R appuser:appgroup /data
|
||||
fi
|
||||
|
||||
# Drop privileges and run the command using gosu
|
||||
exec gosu appuser "$@"
|
||||
else
|
||||
# If not root, just run the command directly
|
||||
exec "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user