awslabs / amazon-emr-on-eks-custom-image-cli

Amazon EMR on EKS Custom Image CLI
Apache License 2.0
25 stars 10 forks source link

"docker cli doesn't exist but is required." when running Docker with Colima on a Mac #15

Open grbinho opened 2 years ago

grbinho commented 2 years ago

Hi everyone,

I ran into an issue when running emr-on-eks-custom-image having docker installed via Colima on a Mac.

Even thought which docker returns a result and I am able to run docker commands in the cli, the tool returns the following error.

Amazon EMR on EKS - Custom Image CLI
Version: 1.02
... Checking if docker cli is installed
[ERROR] docker cli doesn't exist but is required.

It turns out that docker.from_env() is not able to find docker socket when Colima is used.

I was able to work around the issue by exposing DOCKER_HOST environment variable like this

export DOCKER_HOST="$(docker context inspect colima -f '{{ .Endpoints.docker.Host }}')"

Apart from maybe making the error message clear, I don't think there is any real bug here.

This issue is more meant for documenting this workaround.

amravazzi commented 9 months ago

In my case, using docker for mac, the workaround was

sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock

Source

iamriteek commented 1 month ago

can you guys help me with the same issue in windows 11 docker desktop please??