File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,30 @@ print_partial_message() {
3939
4040 echo -e " ${color}${pre_message}${format}${formatted_part}${RESET}${color}${post_message}${RESET} "
4141}
42+
43+ docker_path=$( command -v docker || true)
44+ if [ -n " $docker_path " ]; then
45+ print_partial_message " ⭐️ Found " " docker" " : $docker_path " " $BOLD "
46+ else
47+ print_partial_message " 💥 Could not find " " docker" " . Please follow this link to install Docker Engine..." " $BOLD "
48+ print_message " " " https://docs.docker.com/engine/install/" " $BOLD "
49+ ERROR_CODE=127
50+ fi
51+
52+ current_user=$( whoami)
53+ current_context=$( docker context show)
54+ if id -nG " $current_user " | grep -qw " docker" ; then
55+ print_partial_message " ⭐️ Found " " $current_user " " in the docker group" " $BOLD "
56+ elif [ " $current_context " == " rootless" ]; then
57+ print_message " " " ⭐️ Running Docker as rootless" " $BOLD "
58+ elif [[ " $( uname) " == " Darwin" ]]; then
59+ print_message " " " ⭐️ Running Docker on Darwin" " $BOLD "
60+ else
61+ print_partial_message " 💥 Could not find " " $current_user " " in the docker group. Please add it like this..." " $BOLD "
62+ print_message " " " sudo usermod -aG docker $current_user && newgrp docker" " $BOLD "
63+ ERROR_CODE=1
64+ fi
65+
4266if [ $ERROR_CODE -ne 0 ]; then
4367 print_message " " " There were errors in the setup process. Please fix them and try again." " $BOLD "
4468 exit $ERROR_CODE
You can’t perform that action at this time.
0 commit comments