Jump to content
XPEnology Community

[DOCKER] Impossible to make Portainer to access docker.sock file


Recommended Posts

Hi all,

I'm trying to set up Portainer within Docker, but I have a problem trying to add and also make that change permanent, to allow Portainer look into '/var/run/docker.sock' for the local Endpoint.

 

I have tried both ways, I mean:

- Create and configure the container using the Synology Docker app (GUI), but here, as /var/run is a root directory, I can't load the 'docker.sock' file.

- Create and configure it within Terminal (PuTTY): docker run -d -p 32770:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/Portainer:/data portainer/portainer. But the docker.sock link just disappears after starting it everytime.

 

I have tried to make a symlink of /var/run dir to one of my user volumes so I can access these files easily, but docker.sock image was not shown there, so couldn't link it within Docker container settings.

Sin título-1.jpg

Edited by SmartPhoneLover
Link to comment
Share on other sites

Try to make a symlink of just /var/run/docker.sock and mount the location of the GUI-accessible file to /var/run/docker.sock.

What I ended up doing was to create a scheduled task that runs a script on reboot as root.

 

The contents of the script (which symlinks the file):

sudo ln -s /var/run/docker.sock /volume1/docker/docker.sock

 

Edited by Lethal
Link to comment
Share on other sites

7 minutes ago, SmartPhoneLover said:

Hi, thank you for the answer. Yes, that was what I ended up doing.

Captura.JPG

 

Glad you were able to get it working!

 

 

2 minutes ago, flyride said:

Just curious, what is Portainer doing for you that the native Syno docker manager doesn't?

 

I use Portainer on non-DSM Docker hosts, but never thought to load it up on DSM.

 

Some people think that its easier to manage docker containers using Portainer, likely because they are used to it. Also, it is directly accessible through a web interface unlike DSM's docker.

Link to comment
Share on other sites

9 minutes ago, flyride said:

Just curious, what is Portainer doing for you that the native Syno docker manager doesn't?

 

I use Portainer on non-DSM Docker hosts, but never thought to load it up on DSM.

 

I just wanted to know and see the difference that Portainer seems to offer to manage them. I'm just curious 😉

And, as @Lethal mentioned before, to be able to manage containers without logging in to DSM

Edited by SmartPhoneLover
Link to comment
Share on other sites

Did you ever try to start a compose.yml from the Synology Docker-UI?

That's something Portainer does in the  blink of an eye. Same is true for cleaning up orphaned images and volumes.

 

The Synology Docker-UI has it's strongsuite when it commes to simplicity. You missed to add a volume, portmapping or an environment variable?

Stop you container, do your modifications, start the container and be good :)

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...