From 0b250d871592959cc9297fd98c9dfcc5a43ffb6b Mon Sep 17 00:00:00 2001 From: Greg Rynkowski <5878299+rynkowsg@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:29:14 -0300 Subject: [PATCH] doc: Add troubleshooting note about rootless Docker (#209) * doc: Add troubleshooting note about rootless Docker * f doc: Add troubleshooting note about rootless Docker --- docs/user-guide/troubleshooting/general.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/user-guide/troubleshooting/general.md b/docs/user-guide/troubleshooting/general.md index afb2bda3..b85ac23f 100644 --- a/docs/user-guide/troubleshooting/general.md +++ b/docs/user-guide/troubleshooting/general.md @@ -47,6 +47,8 @@ $ leverage tf shell [17:06:13.754] ERROR Docker daemon doesn't seem to be responding. Please check it is up and running correctly before re-running the command. ``` +### MacOS after Docker Desktop upgrade + We've seen this happen after a Docker Desktop upgrade. Defaults are changed and the Docker daemon no longer uses Unix sockets but TCP, or perhaps it does use Unix sockets but under a different path or user. What has worked for us in order to fix the issue is to make sure the following setting is enabled: @@ -54,6 +56,17 @@ What has worked for us in order to fix the issue is to make sure the following s Note: that setting can be accessed by clicking on the Docker Desktop icon tray, and then clicking on "Settings...". Then click on the "Advanced" tab to find the checkbox. +### Linux and Docker in Rootless mode + +The same problem might come from missing env variable `DOCKER_HOST`. `leverage` looks for Docker socket at `unix:///var/run/docker.sock` unless `DOCKER_HOST` is provided in environment. If you installed Docker in [Rootless mode](https://docs.docker.com/engine/security/rootless/), you need to remember to add `DOCKER_HOST` in you rc files: +```bash +export DOCKER_HOST=unix:///run/user/1000/docker.sock +``` +or prefix the leverage tool with the env var: +```bash +$ DOCKER_HOST=unix:///run/user/1000/docker.sock leverage tf shell +``` + ## Leverage CLI fails to mount the SSH directory The Leverage CLI mounts the `~/.ssh` directory in order to make the pulling of private Terraform modules work. The error should look similar to the following: