frakman1 Posted August 2, 2020 Share Posted August 2, 2020 (edited) @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"? 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 August 2, 2020 by frakman1 Quote Link to comment
sturgismike Posted August 2, 2020 Share Posted August 2, 2020 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"? 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) Quote Link to comment
Squid Posted August 2, 2020 Share Posted August 2, 2020 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 1 Quote Link to comment
frakman1 Posted August 6, 2020 Author Share Posted August 6, 2020 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> Quote Link to comment
frakman1 Posted August 8, 2020 Author Share Posted August 8, 2020 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 Quote Link to comment
frakman1 Posted August 8, 2020 Author Share Posted August 8, 2020 (edited) 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 August 8, 2020 by frakman1 Quote Link to comment
frakman1 Posted August 8, 2020 Author Share Posted August 8, 2020 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 Quote Link to comment
frakman1 Posted August 8, 2020 Author Share Posted August 8, 2020 (edited) 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 August 8, 2020 by frakman1 Quote Link to comment
Meles Meles Posted October 5, 2022 Share Posted October 5, 2022 (edited) 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 October 5, 2022 by Meles Meles Quote Link to comment
Recommended Posts
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.