Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unraid Docker API

Featured Replies

@Squid

Can you please tell me what docker command I could run that returns the values in the table that gets displayed when I click on "Container SIze"?

image.png.fd3e37440d54c3f423e6df6652398333.png

 

I want to be able to graph the output of this data over time to see which containers are growing. I've already used the "limit-log-files" extra parameter trick but still see the docker.img file growing over time.

 

I've tried using "docker system df -v" among others but nothing has displayed a similar table as the "Container Size" one.

 

Edited by frakman1

10 minutes ago, frakman1 said:

@Squid

Can you please tell me what docker command I could run that returns the values in the table that gets displayed when I click on "Container SIze"?

image.png.fd3e37440d54c3f423e6df6652398333.png

 

I want to be able to graph the output of this data over time to see which containers are growing. I've already used the "limit-log-files" extra parameter trick but still see the docker file growing over time.

 

I've tried using "docker system df -v" among others but nothing has displayed a similar table as the "Container Size" one.

 

You can do this (its a bit slow on my system, be patient)

docker container ls -sa --format 'table {{.Names}}\t{{.Size}}'

 

If you want the full data you can drop the --format part.  -s means size, -a means all (so that it will show both active and inactive containers) 

Multiple commands are needed to get the info.  And it's not always 100% reliable due to how docker sometimes works, along with other overhead which is present in the docker.img file

 

But, you're looking at 

 docker ps -sa --format='{{.Names}}|{{.Size}}'

and 

docker inspect --format='{{.LogPath}}' NAME_OF_CONTAINER_HERE|xargs du -b 2>/dev/null |cut -f1

 

  • Author

I'd like to try using the python docker library to access the UnRAID server's docker API. I can't figure out what endpoint to give it. What port number do I use in the format tcp://<ip>:<port>

image.thumb.png.44db5473d95e6eb6091b7b3c68656cc9.png

  • Author

I found the following ports using netstat but they don't look like the standard port numbers mentioned in the documentation (port 2375) and they are all ipv6.

@Squid Any ideas how to access the REST API remotely?

 

 

# netstat -tulpn | grep LISTEN | grep docker
tcp6       0      0 :::6090                 :::*                    LISTEN      20241/docker-proxy  
tcp6       0      0 :::8112                 :::*                    LISTEN      19128/docker-proxy  
tcp6       0      0 :::8118                 :::*                    LISTEN      19115/docker-proxy  
tcp6       0      0 :::58846                :::*                    LISTEN      19102/docker-proxy  
tcp6       0      0 :::6080                 :::*                    LISTEN      20255/docker-proxy  
tcp6       0      0 :::58946                :::*                    LISTEN      19074/docker-proxy  

 

  • Author

I read that the docker daemon has to be bound to an IP/port socket like this:

 

/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376

 

Can someone point me to where the docker config/startup files are?

Edited by frakman1

  • Author

OK. I found the bulk of it here: /etc/rc.d/rc.docker

and some config options here: /boot/config/docker.cfg

No mention of any IP port binding though

  • Author

I found a different workaround. Rather than trying to enable the HTTP REST API by changing the dockerd statup option, I decided to use the built-in feature of the docker client to use the ssh protocol to access a remote docker server. This requires that you've already setup public/private key ssh access to your UnRAID server (details here)

 

Once that is working, I can just run this from my client:

 

$docker -H ssh://root@tower:22 ps
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS                PORTS           blahh blah

 

Edited by frakman1

  • 2 years later...

a bit of a necro-post, but I was having a play around with this earlier, and to get it working you just need to put

 

DOCKER_OPTS="-H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock"

 

into /boot/config/docker.cfg

 

of course, you then get the warning...

 

Quote

WARNING: API is accessible on http://0.0.0.0:2376 without encryption.
         Access to the remote API is equivalent to root access on the host. Refer
         to the 'Docker daemon attack surface' section in the documentation for
         more information: https://docs.docker.com/go/attack-surface/

 

 

And the Docker Start Stop page in the UI cracks the whoops a bit as well....

 

I'm actually now moving onto using a dockersocket proxy container instead (tecnativa/docker-socket-proxy)

Edited by Meles Meles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.