Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect dockersubpackages (and lxc and friends) #21

Open
wdoekes opened this issue Jan 19, 2017 · 3 comments
Open

Collect dockersubpackages (and lxc and friends) #21

wdoekes opened this issue Jan 19, 2017 · 3 comments

Comments

@wdoekes
Copy link
Member

wdoekes commented Jan 19, 2017

Similar to app.vzlist, an app.dockerps but with dpkg-listings..

Something like that...

@wdoekes
Copy link
Member Author

wdoekes commented Jul 4, 2017

virt.docker:

{"my_container": {
   "name": NAME,
   "uptime": UPTIME(?),
   "image_digest": HASH,
   "image_tag": TAG,
   "os.pkg": {

call os.pkg with container-root from
/proc/$(docker inspect -f '{{.State.Pid}}' whmcs-web)/root/

}}}

@wdoekes
Copy link
Member Author

wdoekes commented Jul 4, 2017

Example info:

# printf 'GET /containers/json HTTP/1.0\r\n\r\n' | nc -U /var/run/docker.sock | sed -e '1,/^.$/d' | jq
[
  {
    "Id": "390...",
    "Names": [
      "/xxx_sip_1"
    ],
    "Image": "xxx_sip",
    "ImageID": "sha256:dba...",
    "Command": "/bin/sh -c 'while true; do sleep 60; done'",
    "Created": 1498636085,
    "Ports": [],
    "Labels": {
      "com.docker.compose.config-hash": "a8f...",
      "com.docker.compose.container-number": "1",
      "com.docker.compose.oneoff": "False",
      "com.docker.compose.project": "xxx",
      "com.docker.compose.service": "sip",
      "com.docker.compose.version": "1.13.0"
    },
    "State": "running",
    "Status": "Up 6 days",
    "HostConfig": {
      "NetworkMode": "xxx_net"
    },
    "NetworkSettings": {
      "Networks": {
        "xxx_net": {
          "IPAMConfig": null,
          "Links": null,
          "Aliases": null,
          "NetworkID": "484xxx",
          "EndpointID": "b81xxx",
          "Gateway": "172.20.0.254",
          "IPAddress": "172.20.0.4",
          "IPPrefixLen": 24,
          "IPv6Gateway": "",
          "GlobalIPv6Address": "",
          "GlobalIPv6PrefixLen": 0,
          "MacAddress": "02:42:ac:14:00:04"
        }
      }
    },
    "Mounts": []
  },

Missing info:

  • storage-engine
"zfs"
  • pids
write(3, "GET /v1.24/containers/390f566be012/json HTTP/1.1\r\nHost: docker\r\nUser-Agent: Docker-Client/1.12.6 (linux)\r\n\r\n", 108) = 108
[
    {
        "Id": "390...",
        "Created": "2017-06-28T07:48:05.843224911Z",
        "Path": "/bin/sh",
        "Args": [
            "-c",
            "while true; do sleep 60; done"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 19938,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2017-06-28T07:48:06.291334324Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },

@wdoekes
Copy link
Member Author

wdoekes commented Jul 4, 2017

FYI: filters:

GET /v1.24/containers/json?filters=%7B%22name%22%3A%7B%22xxx_sip_1%22%3Atrue%7D%7D

No column limiting there.

Just fetch the docker containers through /containers/json | jq .[].Id directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant