Skip to content

Docker

In this section you will learn how to get information about docker, images, containers, container stats and processes inside a docker container:

For function reference and examples we assume, that we imported systeminspector as follows:

const si = require('@ambicuity/systeminspector');

Container, Stats, Processes

All functions in this section return a promise or can be called with a callback function (parameter cb in the function reference)

FunctionResult objectLinuxBSDMacWinSunComments
si.dockerInfo(cb)XXXXXreturns general docker info
idXXXXXDocker ID
containersXXXXXnumber of containers
containersRunningXXXXXnumber of running containers
containersPausedXXXXXnumber of paused containers
containersStoppedXXXXXnumber of stopped containers
imagesXXXXXnumber of images
driverXXXXXdriver (e.g. 'devicemapper', 'overlay2')
memoryLimitXXXXXhas memory limit
SwapLimitXXXXXhas swap limit
kernelMemoryXXXXXhas kernel memory
cpuCfsPeriodXXXXXhas CpuCfsPeriod
cpuCfsQuotaXXXXXhas CpuCfsQuota
cpuSharesXXXXXhas CPUShares
cpuSetXXXXXhas CPUShares
ipv4ForwardingXXXXXhas IPv4Forwarding
bridgeNfIptablesXXXXXhas BridgeNfIptables
bridgeNfIp6tablesXXXXXhas BridgeNfIp6tables
debugXXXXXDebug on
nfdXXXXXnamed data networking forwarding daemon
oomKillDisableXXXXXout-of-memory kill disabled
ngoroutinesXXXXXnumber NGoroutines
systemTimeXXXXXdocker SystemTime
loggingDriverXXXXXlogging driver e.g. 'json-file'
cgroupDriverXXXXXcgroup driver e.g. 'cgroupfs'
nEventsListenerXXXXXnumber NEventsListeners
kernelVersionXXXXXdocker kernel version
operatingSystemXXXXXdocker OS e.g. 'Docker for Mac'
osTypeXXXXXOSType e.g. 'linux'
architectureXXXXXarchitecture e.g. x86_64
ncpuXXXXXnumber of CPUs
memTotalXXXXXmemory total
dockerRootDirXXXXXdocker root directory
httpProxyXXXXXhttp proxy
httpsProxyXXXXXhttps proxy
noProxyXXXXXNoProxy
nameXXXXXName
labelsXXXXXarray of labels
experimentalBuildXXXXXis experimental build
serverVersionXXXXXserver version
clusterStoreXXXXXcluster store
clusterAdvertiseXXXXXcluster advertise
defaultRuntimeXXXXXdefault runtime e.g. 'runc'
liveRestoreEnabledXXXXXlive store enabled
isolationXXXXXisolation
initBinaryXXXXXinit binary
productLicenseXXXXXproduct license
si.dockerImages(all, cb)[{...}]XXXXXreturns array of top level/all docker images
[0].idXXXXXimage ID
[0].containerXXXXXcontainer ID
[0].commentXXXXXcomment
[0].osXXXXXOS
[0].architectureXXXXXarchitecture
[0].parentXXXXXparent ID
[0].dockerVersionXXXXXdocker version
[0].sizeXXXXXimage size
[0].sharedSizeXXXXXshared size
[0].virtualSizeXXXXXvirtual size
[0].authorXXXXXauthor
[0].createdXXXXXcreated date / time
[0].containerConfigXXXXXcontainer config object
[0].graphDriverXXXXXgraph driver object
[0].repoDigestsXXXXXrepo digests array
[0].repoTagsXXXXXrepo tags array
[0].configXXXXXconfig object
[0].rootFSXXXXXroot fs object
si.dockerContainers(all, cb)[{...}]XXXXXreturns array of active/all docker containers
[0].idXXXXXID of container
[0].nameXXXXXname of container
[0].imageXXXXXname of image
[0].imageIDXXXXXID of image
[0].commandXXXXXcommand
[0].createdXXXXXcreation time (unix time)
[0].startedXXXXXstarted time (unix time)
[0].finishedXXXXXfinished time (unix time)
[0].createdAtXXXXXcreation date time string
[0].startedAtXXXXXcreation date time string
[0].finishedAtXXXXXcreation date time string
[0].stateXXXXXcreated, running, exited
[0].restartCountXXXXXrestart count
[0].platformXXXXXe.g. linux
[0].driverXXXXXe.g. overlay2 or devicemapper
[0].portsXXXXXarray of ports
[0].mountsXXXXXarray of mounts
si.dockerContainerStats(ids, cb)[{...}]XXXXXstatistics for specific containers
container IDs: space or comma separated,
pass '*' for all containers
[0].idXXXXXContainer ID
[0].memUsageXXXXXmemory usage in bytes
[0].memLimitXXXXXmemory limit (max mem) in bytes
[0].memPercentXXXXXmemory usage in percent
[0].cpuPercentXXXXXcpu usage in percent
[0].pidsXXXXXnumber of processes
[0].netIO.rxXXXXXreceived bytes via network
[0].netIO.wxXXXXXsent bytes via network
[0].blockIO.rXXXXXbytes read from BlockIO
[0].blockIO.wXXXXXbytes written to BlockIO
[0].restartCountXXXXXrestart count
[0].cpuStatsXXXXXdetailed cpu stats
[0].precpuStatsXXXXXcpu statistic of previous read
[0].memoryStatsXXXXXdetailed memory stats
[0].networksXXXXXdetailed network stats per interface
si.dockerContainerProcesses(id, cb)[{...}]XXXXXarray of processes inside a container
[0].pidHostXXXXXprocess ID (host)
[0].ppidXXXXXparent process ID
[0].pgidXXXXXprocess group ID
[0].userXXXXXeffective user name
[0].ruserXXXXXreal user name
[0].groupXXXXXeffective group name
[0].rgroupXXXXXreal group name
[0].statXXXXXprocess state
[0].timeXXXXXaccumulated CPU time
[0].elapsedXXXXXelapsed running time
[0].niceXXXXXnice value
[0].rssXXXXXresident set size
[0].vszXXXXXvirtual size in Kbytes
[0].commandXXXXXcommand and arguments
si.dockerVolumes(cb)[{...}]XXXXXreturns array of docker volumes
[0].nameXXXXXvolume name
[0].driverXXXXXdriver
[0].labelsXXXXXlabels object
[0].mountpointXXXXXmountpoint
[0].optionsXXXXXoptions
[0].scopeXXXXXscope
[0].createdXXXXXcreated at
si.dockerAll(cb)XXXXXlist of all containers including their stats
and processes in one single array
Inspector AI
SystemInspector AI initialized. How can I help you query your hardware?