mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
dev_cli: Add a shell command
And drop the caller into a privileged root shell. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
d824d55562
commit
5a6b8d6323
@ -167,6 +167,9 @@ cmd_help() {
|
|||||||
echo " clean [<cargo args>]]"
|
echo " clean [<cargo args>]]"
|
||||||
echo " Remove the Cloud Hypervisor artifacts."
|
echo " Remove the Cloud Hypervisor artifacts."
|
||||||
echo ""
|
echo ""
|
||||||
|
echo " shell"
|
||||||
|
echo " Run the development container into an interactive, privileged BASH shell."
|
||||||
|
echo ""
|
||||||
echo " help"
|
echo " help"
|
||||||
echo " Display this help message."
|
echo " Display this help message."
|
||||||
echo ""
|
echo ""
|
||||||
@ -351,6 +354,29 @@ cmd_build-container() {
|
|||||||
$BUILD_DIR
|
$BUILD_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd_shell() {
|
||||||
|
say_warn "Starting a privileged shell prompt as root ..."
|
||||||
|
say_warn "WARNING: Your $CLH_ROOT_DIR folder will be bind-mounted in the container under $CTR_CLH_ROOT_DIR"
|
||||||
|
$DOCKER_RUNTIME run \
|
||||||
|
-ti \
|
||||||
|
--workdir "$CTR_CLH_ROOT_DIR" \
|
||||||
|
--rm \
|
||||||
|
--privileged \
|
||||||
|
--security-opt seccomp=unconfined \
|
||||||
|
--ipc=host \
|
||||||
|
--net=host \
|
||||||
|
--tmpfs /tmp:exec \
|
||||||
|
--volume /dev:/dev \
|
||||||
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \
|
||||||
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
|
--env USER="root" \
|
||||||
|
--env CH_LIBC="${libc}" \
|
||||||
|
--entrypoint bash \
|
||||||
|
"$CTR_IMAGE"
|
||||||
|
|
||||||
|
fix_dir_perms $?
|
||||||
|
}
|
||||||
|
|
||||||
# Parse main command line args.
|
# Parse main command line args.
|
||||||
#
|
#
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user