Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
clive
Commits
6659e188
Commit
6659e188
authored
8 months ago
by
Bartek Wrona
Browse files
Options
Downloads
Patches
Plain Diff
Docker entrypoint and startup script support clive user ID switching (to match host user)
parent
9d31fb4c
No related branches found
No related tags found
2 merge requests
!455
V1.27.5.15 release
,
!442
issue #251 - defined script to launch clive-TUI.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docker/entrypoint.sh
+26
-1
26 additions, 1 deletion
docker/entrypoint.sh
scripts/start_clive.sh.template
+1
-1
1 addition, 1 deletion
scripts/start_clive.sh.template
with
27 additions
and
2 deletions
docker/entrypoint.sh
+
26
−
1
View file @
6659e188
#!
/bin/bash
#!/bin/bash
set
-euo
pipefail
SCRIPTPATH
=
"
$(
cd
--
"
$(
dirname
"
$0
"
)
"
>
/dev/null 2>&1
;
pwd
-P
)
"
if
[[
"
$EUID
"
-eq
0
]]
;
then
if
[[
-z
"
${
CLIVE_UID
:-}
"
]]
;
then
echo
"Warning: variable CLIVE_UID is not set or set to an empty value."
>
&2
elif
!
[[
"
${
CLIVE_UID
}
"
=
~ ^[0-9]+
$
]]
;
then
echo
"Error: variable CLIVE_UID is set to '
${
CLIVE_UID
}
' and not an integer. Exiting..."
>
&2
exit
1
elif
[[
"
${
CLIVE_UID
}
"
-ne
0
]]
;
then
if
[[
"
${
CLIVE_UID
}
"
-ne
$(
id
-u
clive
)
]]
;
then
echo
"Setting user clive's UID to value '
${
CLIVE_UID
}
'"
usermod
-o
-u
"
${
CLIVE_UID
}
"
clive
fi
echo
"Respawning entrypoint as user clive"
sudo
-HEnu
clive /bin/bash
"
${
SCRIPTPATH
}
/entrypoint.sh"
"
$@
"
exit
0
fi
fi
TESTNET_NODE_LOG_FILE
=
testnet_node.log
print_help
()
{
...
...
@@ -57,6 +79,9 @@ while [ $# -gt 0 ]; do
shift
done
cd
/clive
source
"
${
PYTHON_VENV_PATH
}
/bin/activate"
if
[
"
${
TESTNET_MODE
}
"
=
"0"
]
;
then
if
[
"
${
INTERACTIVE_CLI_MODE
}
"
=
"0"
]
;
then
echo
"Launching clive in TUI mode on mainnet"
...
...
This diff is collapsed.
Click to expand it.
scripts/start_clive.sh.template
+
1
−
1
View file @
6659e188
...
...
@@ -109,4 +109,4 @@ then
add_docker_arg
"
${
CLIVE_DATA_LOCATION_DIR
}
:
${
CLIVE_DATA_LOCATION_DIR
}
"
fi
docker run
--detach-keys
=
'ctrl-@,ctrl-q'
--rm
-it
-e
H
IVE
D
_UID
=
"
$(
id
-u
)
"
--stop-timeout
=
180
"
${
DOCKER_ARGS
[@]
}
"
"
${
IMAGE_NAME
}
"
"
${
CMD_ARGS
[@]
}
"
docker run
--detach-keys
=
'ctrl-@,ctrl-q'
--rm
-it
-e
CL
IVE_UID
=
"
$(
id
-u
)
"
--stop-timeout
=
180
"
${
DOCKER_ARGS
[@]
}
"
"
${
IMAGE_NAME
}
"
"
${
CMD_ARGS
[@]
}
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment