mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/dbeaver-devops#1630 Added if for root and non-root users (#3180)
* dbeaver/dbeaver-devops#1630 Added if for root and non-root users * dbeaver/dbeaver-devops#1630 Added creating dir /home/dbeaver --------- Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
co-authored by
Daria Marutkina
parent
3ceac40016
commit
529186df41
@@ -5,7 +5,15 @@
|
||||
# Change ownership of the WORKDIR to the dbeaver user and group
|
||||
# Variables DBEAVER_<UID|GID> are defined in the Dockerfile and exported to the runtime environment
|
||||
# PWD equals WORKDIR value from product Dockerfile
|
||||
chown -R $DBEAVER_UID:$DBEAVER_GID $PWD
|
||||
|
||||
# Execute run-server.sh as the dbeaver user with the JAVA_HOME and PATH environment variables
|
||||
exec su dbeaver -c "JAVA_HOME=$JAVA_HOME PATH=$PATH ./run-server.sh"
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
TARGET_USER=${TARGET_USER:-dbeaver}
|
||||
TARGET_UID=${TARGET_UID:-$DBEAVER_UID}
|
||||
TARGET_GID=${TARGET_GID:-$DBEAVER_GID}
|
||||
|
||||
chown -R $DBEAVER_UID:$DBEAVER_GID $PWD
|
||||
# Execute run-server.sh as the dbeaver user with the JAVA_HOME and PATH environment variables
|
||||
exec su "$TARGET_USER" -c "JAVA_HOME=$JAVA_HOME PATH=$PATH ./run-server.sh"
|
||||
else
|
||||
exec ./run-server.sh
|
||||
fi
|
||||
Reference in New Issue
Block a user