goldmann / docker-squash

Docker image squashing tool
MIT License
831 stars 108 forks source link

Could not create Docker client #230

Closed hexergogo closed 1 year ago

hexergogo commented 1 year ago

❯ docker-squash -t spark-base:3.3 spark-base-s:3.3 2023-06-08 15:23:45,208 root ERROR Could not create Docker client, please make sure that you specified valid parameters in the 'DOCKER_HOST' environment variable. 2023-06-08 15:23:45,208 root ERROR Error while creating the Docker client: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')) 2023-06-08 15:23:45,208 root ERROR Execution failed, consult logs above. If you think this is our fault, please file an issue: https://github.com/goldmann/docker-squash/issues, thanks!

goldmann commented 1 year ago

A few questions:

  1. Is Docker running?
  2. Are you running Docker locally or connecting to a remote Daemon?
  3. If locally: do you have the /var/run/docker.sock file?
  4. Do you have the DOCKER_HOST environment variable set?
hexergogo commented 1 year ago

Thx, Mac's docker.sock file is not in /var/run, need sudo ln -s /Users/{user}/.docker/run/docker.sock /var/run/docker.sock

goldmann commented 1 year ago

Or, alternatively you can do: export DOCKER_HOST="unix:///Users/{user}/.docker/run/docker.sock".

hexergogo commented 1 year ago

Cool! 🤩