Unraid Docker API


frakman1

8 posts in this topic Last Reply

Recommended Posts

@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
Link to post
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) 

Link to post

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

 

Link to post

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  

 

Link to post

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
Link to post

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
Link to post

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...

×   Pasted as rich text.   Restore formatting

  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.