An open and reliable container runtime https://github.com/containerd/containerd
Go to file
Michael Crosby 779cb69e6d Refactor event loop with types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-01 10:55:13 -08:00
api/v1 Add funcs for events endpoint 2015-11-30 15:46:36 -08:00
containerd Add basic stats 2015-11-30 15:34:10 -08:00
.gitignore Improve process addition and removal 2015-11-13 13:25:03 -08:00
README.md Improve process addition and removal 2015-11-13 13:25:03 -08:00
add_process.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
container.go Improve process addition and removal 2015-11-13 13:25:03 -08:00
delete.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
errors.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
event.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
exit.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
get_containers.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
journal.go Add journal queue 2015-11-13 14:09:35 -08:00
runtime.go Add basic log support 2015-11-13 13:25:03 -08:00
runtime_linux.go Add journal queue 2015-11-13 14:09:35 -08:00
signal.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
start.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
stats.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
supervisor.go Refactor event loop with types 2015-12-01 10:55:13 -08:00
update.go Refactor event loop with types 2015-12-01 10:55:13 -08:00

README.md

containerd

another container runtime

Start a container:

curl -XPOST localhost:8888/containers/redis -d '{"bundlePath": "/containers/redis"}' 

Add a process:

curl -s -XPUT localhost:8888/containers/redis/process -d@process.json | json_pp                   
{
   "pid" : 25671,
   "user" : {
      "gid" : 0,
      "uid" : 0
   },
   "args" : [
      "sh",
      "-c",
      "sleep 10"
   ],
   "env" : [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "TERM=xterm"
   ]
}

Get containers:

curl -s localhost:8888/containers | json_pp
{
   "containers" : [
      {
         "processes" : [
            {
               "args" : [
                  "sh",
                  "-c",
                  "sleep 60"
               ],
               "user" : {
                  "gid" : 0,
                  "uid" : 0
               },
               "pid" : 25743,
               "env" : [
                  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                  "TERM=xterm"
               ]
            }
         ],
         "id" : "redis",
         "state" : {
            "status" : "running"
         },
         "bundlePath" : "/containers/redis"
      }
   ]
}

Other stuff:

# pause and resume a container
curl -XPATCH localhost:8888/containers/redis -d '{"status": "paused"}'
curl -XPATCH localhost:8888/containers/redis -d '{"status": "running"}'

# send signal to a container's specific process
curl -XPOST localhost:8888/containers/redis/process/18306 -d '{"signal": 9}'