https://rancher.com/ logo
Title
n

nutritious-ram-11422

03/01/2023, 7:07 PM
Hello 🙂 guys, I’m having a little problem with the docker.sock and other tools like
testcontainers
& `sam aws`… I think I found the “solution”, but i dont know if it could be solved natively by Rancher Desktop… Here it is: I installed the Rancher Desktop on MAC (intel), using dockerd as engine… it’s just works fine, but testcontainers and sam aws (sam build --use-container) cannot connect or find the docker environment…. the solution that I found is recreate the symlink
/var/run/docker.sock
pointing it to
~/.rm/docker.sock
… but everytime I restart the mac, this symlink just recover to the “original” path
~/.docker/run/docker.sock
should it be working like this or it should keep the symlink pointing to where I configured? Rancher Desktop Versiob: 1.7.0 docker context is pointing to rancher-desktop who has the docker endpoint configured to ~/.rd/docker.sock
❯ docker context ls                       
NAME                DESCRIPTION                               DOCKER ENDPOINT                                  KUBERNETES ENDPOINT                                                                  ORCHESTRATOR
default             Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                      <https://7746C97A9B6D446EDC0E2C7B437EE8D4.gr7.us-east-1.eks.amazonaws.com> (default)   swarm
rancher-desktop *   Rancher Desktop moby context              unix:///Users/felipe.campigoto/.rd/docker.sock
(I deleted the linux-desktop 🤔 )
f

fast-garage-66093

03/01/2023, 8:00 PM
It sounds like you have Docker Desktop installed as well, and auto-start it at login because (afaik) there is no code in Rancher Desktop that would create a symlink pointing to
~/.docker/run/docker.sock
n

nutritious-ram-11422

03/01/2023, 8:05 PM
well, I uninstalled the Docker Desktop before Rancher Desktop 🤔 Maybe could have some garbage of Docker Desktop? Something not deleted when I uninstalled this? Have some tool that I could make some “clean” about apps uninstalled and have some garbage on mac?
f

fast-garage-66093

03/01/2023, 8:09 PM
I don't know. Did you verify that
/Applications/Docker.app
is gone, and not installed in
$HOME/Applications/Docker.app
either?
Check your
$HOME/Library/LaunchAgents
directory if you see anything in there from docker...
Sorry, I don't have Docker Desktop installed, so can't tell you what exactly to look for
n

nutritious-ram-11422

03/01/2023, 8:12 PM
Yeah, I dont have Docker.app in any of these paths.. well, thank you anyway 🙂
f

fast-garage-66093

03/01/2023, 8:14 PM
I don't know; maybe one of your other tools, like
testcontainers
or
sam aws
is trying to be helpful and changes things for you?
w

white-xylophone-9961

03/01/2023, 8:15 PM
I followed https://nektony.com/how-to/uninstall-docker-on-mac and used brew to install docker and docker-compose.
ls -ld /usr/local/bin/docker*
and ensure not pointing to Docker.app. After starting rancher, try
docker info
and if that doesn't work,
sudo rm /var/run/docker.sock
and restart rancher.
n

nutritious-ram-11422

03/01/2023, 8:16 PM
I don`t think so, I restarted the mac and the first thing I did was check the symlink, and the result is it back to
~/.docker/run/docker.sock
😕
testcontainers
is just a tool for execute in
unit/integration tests
Thanks @white-xylophone-9961 I’ll check this
f

fast-garage-66093

03/01/2023, 8:16 PM
Well, there must be some application that is auto-started that does this, which is why I recommend to audit the LaunchAgents
And maybe the auto-start items in your user's preferences settings
n

nutritious-ram-11422

03/01/2023, 8:17 PM
nice, I’ll try everything
f

fast-garage-66093

03/01/2023, 8:18 PM
@white-xylophone-9961 is there a specific reason you install
docker
and
docker-compose
using
brew
and not use the versions provided by Rancher Desktop ?
w

white-xylophone-9961

03/01/2023, 8:19 PM
@fast-garage-66093 I wanted to keep as generic as possible. Docker tools should use the api.
f

fast-garage-66093

03/01/2023, 8:21 PM
@white-xylophone-9961 The
docker
and
docker-compose
binaries in Rancher Desktop are from the upstream project; only the Windows versions has a small patch applied to it. So yes, the versions from
brew
should work perfectly fine; I was just wondering why you prefer them, as it seems like an extra step.
@nutritious-ram-11422 The articled linked above by @white-xylophone-9961 has some additional locations to check for uninstalling Docker manually; please check it out!
w

white-xylophone-9961

03/01/2023, 8:23 PM
@fast-garage-66093 good to know, but I was trying another docker replacement as well, colima I think, and wanted to eliminate the cli's themselves, in case things didn't work as expected.
f

fast-garage-66093

03/01/2023, 8:23 PM
sure, it should all work either way; I was just curious
n

nutritious-ram-11422

03/01/2023, 8:24 PM
I think I already made some validation in theses paths in the article.. 👀 but I’ll double check to be sure… If I have a progress with it, I update this thread
Mornin’ I came to say thank you very much to you guys 🙂 the article helped me, the symlink is not creating anymore to docker path… but now, any symlink is created, so, if I need the docker.sock on /var/run/docker.sock I still need to create by my own, right?
Sorry, I just reinstall the Rancher Desktop I uninstalled by
brew
and download the .dmg on rancher desktop site and installed by .dmg now I can configure
administrative access
on dashboard preferences and it just works fine 🙂
w

white-xylophone-9961

03/02/2023, 2:55 PM
do you really need
administrative access
?
n

nutritious-ram-11422

03/02/2023, 4:44 PM
well, it was the default configuration when I fresh installed the Rancher Desktop and I think with this
administrative access
the Rancher made the symlink to
/var/run/docker.sock
where the testcontainer and sam cli get the docker env
it’s because, at least on mac, to create a symlink on
/var/run/docker.sock
needs
sudo
You think that without administrative access, the Rancher still can create the symlink to
/var/run/docker.sock
every startup of SO?
w

white-xylophone-9961

03/02/2023, 5:12 PM
probably not, I don't have it; Rancher creates in ~/.rd/docker.sock for me. But if your tools need it, so be it; was just curious.
n

nutritious-ram-11422

03/02/2023, 5:13 PM
Ah ok, yeah, Rancher creates right is this path and I need to symlink it to /var/run/docker.sock, aka
sudo ln -sf /var/run/docker.sock ~/.rd/docker.sock
f

fast-garage-66093

03/02/2023, 5:15 PM
This is only needed for old-style tools that don't know about docker contexts. Otherwise you can just use
docker context use rancher-desktop
and not worry about it.
But if you have tools that have hard-coded
/var/run/docker.sock
, then you need the symlink
n

nutritious-ram-11422

03/02/2023, 5:18 PM
I think I need it anyway 😕 I tried to deleted the symlink, configured docker context to
rancher-desktop
and run the tools, none worked since I created the symlink, those tools worked like a charm but good to know about it, thanks again
f

fast-garage-66093

03/02/2023, 5:19 PM
Or you could try
export DOCKER_HOST=unix:///Users/Capiroto/.rd/docker.sock
(or whatever your user name is), and see if the tool supports that. It is an older mechanism to specify a different location for the socket, so this might work, even if docker contexts are not supported.
n

nutritious-ram-11422

03/02/2023, 5:19 PM
I tried it too
f

fast-garage-66093

03/02/2023, 5:20 PM
Ok, the run with admin privileges and file an enhancement request against the tools to start supporting docker contexts
n

nutritious-ram-11422

03/02/2023, 5:21 PM
I know that the
testcontainer
have this env “*TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE”* but “sam” I dont know if it have any to override it
f

fast-garage-66093

03/02/2023, 5:21 PM
The annoying thing is that
/var/run
will be deleted on each boot, so you will be prompted for the admin password again every time you reboot the machine
👍 1
One day we'll do this via a privileged helper process, but we don't have anybody who has time to work on that in the near future
n

nutritious-ram-11422

03/02/2023, 5:23 PM
he annoying thing is that
/var/run
will be deleted on each boot, so you will be prompted for the admin password again every time you reboot the machine
I’m accepting my destiny with this 🥲 at least will be just when I startup my mac..