Skip to content

Commit

Permalink
[k8s] Surface docker permission error for sky local up (#2913)
Browse files Browse the repository at this point in the history
* fix docker permission error in issue 2592

* Update sky/utils/kubernetes/create_cluster.sh permission error message

Co-authored-by: Romil Bhardwaj <[email protected]>

---------

Co-authored-by: Romil Bhardwaj <[email protected]>
  • Loading branch information
Shrinandan-N and romilbhardwaj authored Dec 29, 2023
1 parent 20013e5 commit 6c0cbcc
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions sky/utils/kubernetes/create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ set -e
PORT_RANGE_START=30000
PORT_RANGE_END=30100

# Check if docker is running
if ! docker info > /dev/null 2>&1; then
>&2 echo "Docker is not running. Please start Docker and try again."
# Temporarily disable 'exit on error' to capture docker info output
set +e
docker_output=$(docker info 2>&1)
exit_status=$?
set -e

# Check if docker info command was successful
if [ $exit_status -ne 0 ]; then
# Check for 'permission denied' in docker output
if echo "$docker_output" | grep -q "permission denied"; then
>&2 echo "Permission denied while trying to connect to the Docker daemon socket. Make sure your user is added to the docker group or has appropriate permissions. Instructions: https://docs.docker.com/engine/install/linux-postinstall/"
else
>&2 echo "Docker is not running. Please start Docker and try again."
fi
exit 1
fi

Expand Down

0 comments on commit 6c0cbcc

Please sign in to comment.