Spaces:
Sleeping
Sleeping
Commit ·
3098775
1
Parent(s): dc0b645
fix
Browse files
run.sh
CHANGED
|
@@ -8,7 +8,7 @@ ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
| 8 |
if [[ $(id -u) -eq 0 ]]; then
|
| 9 |
echo "This script cannot be executed with root privileges."
|
| 10 |
echo "Please re-run without sudo and follow instructions to configure docker for non-root user if needed."
|
| 11 |
-
|
| 12 |
fi
|
| 13 |
|
| 14 |
# Check if user can run docker without root.
|
|
@@ -17,14 +17,14 @@ if [[ ! $(groups $USER) =~ $RE ]]; then
|
|
| 17 |
echo "User |$USER| is not a member of the 'docker' group and cannot run docker commands without sudo."
|
| 18 |
echo "Run 'sudo usermod -aG docker \$USER && newgrp docker' to add user to 'docker' group, then re-run this script."
|
| 19 |
echo "See: https://docs.docker.com/engine/install/linux-postinstall/"
|
| 20 |
-
|
| 21 |
fi
|
| 22 |
|
| 23 |
# Check if able to run docker commands.
|
| 24 |
if [[ -z "$(docker ps)" ]] ; then
|
| 25 |
echo "Unable to run docker commands. If you have recently added |$USER| to 'docker' group, you may need to log out and log back in for it to take effect."
|
| 26 |
echo "Otherwise, please check your Docker installation."
|
| 27 |
-
|
| 28 |
fi
|
| 29 |
|
| 30 |
PLATFORM="$(uname -m)"
|
|
@@ -35,7 +35,4 @@ if [ $PLATFORM = "x86_64" ]; then
|
|
| 35 |
docker run -it --rm -v $ROOT:/app -w /app --network host ghcr.io/moriyalab/lab_tool:latest /bin/bash
|
| 36 |
else
|
| 37 |
echo "Not Support Platform. Only support x86."
|
| 38 |
-
docker pull ghcr.io/moriyalab/lab_tool:latest
|
| 39 |
-
docker run -it --rm -v $ROOT:/app -w /app --network host ghcr.io/moriyalab/lab_tool:latest /bin/bash
|
| 40 |
-
|
| 41 |
fi
|
|
|
|
| 8 |
if [[ $(id -u) -eq 0 ]]; then
|
| 9 |
echo "This script cannot be executed with root privileges."
|
| 10 |
echo "Please re-run without sudo and follow instructions to configure docker for non-root user if needed."
|
| 11 |
+
exit 1
|
| 12 |
fi
|
| 13 |
|
| 14 |
# Check if user can run docker without root.
|
|
|
|
| 17 |
echo "User |$USER| is not a member of the 'docker' group and cannot run docker commands without sudo."
|
| 18 |
echo "Run 'sudo usermod -aG docker \$USER && newgrp docker' to add user to 'docker' group, then re-run this script."
|
| 19 |
echo "See: https://docs.docker.com/engine/install/linux-postinstall/"
|
| 20 |
+
exit 1
|
| 21 |
fi
|
| 22 |
|
| 23 |
# Check if able to run docker commands.
|
| 24 |
if [[ -z "$(docker ps)" ]] ; then
|
| 25 |
echo "Unable to run docker commands. If you have recently added |$USER| to 'docker' group, you may need to log out and log back in for it to take effect."
|
| 26 |
echo "Otherwise, please check your Docker installation."
|
| 27 |
+
exit 1
|
| 28 |
fi
|
| 29 |
|
| 30 |
PLATFORM="$(uname -m)"
|
|
|
|
| 35 |
docker run -it --rm -v $ROOT:/app -w /app --network host ghcr.io/moriyalab/lab_tool:latest /bin/bash
|
| 36 |
else
|
| 37 |
echo "Not Support Platform. Only support x86."
|
|
|
|
|
|
|
|
|
|
| 38 |
fi
|