2016-09-21 03:22:23 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package docker.containerkit.v1;
|
|
|
|
|
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
import "github.com/docker/containerkit/api/types/mount/mount.proto";
|
|
|
|
|
2016-09-22 18:29:20 +00:00
|
|
|
service Containers {
|
|
|
|
rpc Create(CreateRequest) returns (CreateResponse);
|
|
|
|
rpc Start(StartRequest) returns (StartResponse);
|
|
|
|
rpc Stop(StopRequest) returns (StopResponse);
|
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
|
|
|
rpc List(ListRequest) returns (ListResponse);
|
|
|
|
rpc State(StateRequest) returns (StateResponse);
|
|
|
|
rpc Exec(ExecRequest) returns (ExecResponse);
|
|
|
|
rpc Update(UpdateRequest) returns (UpdateResponse);
|
|
|
|
}
|
2016-09-21 03:22:23 +00:00
|
|
|
|
|
|
|
message Container {
|
2016-09-22 18:29:20 +00:00
|
|
|
ContainerSpec container = 1;
|
2016-09-21 03:22:23 +00:00
|
|
|
// Runtime properties go here.
|
|
|
|
}
|
|
|
|
|
|
|
|
// Container specifies runtime parameters for a container.
|
|
|
|
message ContainerSpec {
|
|
|
|
// name must be a unique name to identify the container.
|
|
|
|
//
|
|
|
|
// This can be used as a system identifier external to ContainerKit services.
|
|
|
|
string name = 1;
|
|
|
|
|
|
|
|
// Labels defines labels to be added to the container at creation time. If
|
|
|
|
// collisions with system labels occur, these labels will be overridden.
|
|
|
|
//
|
|
|
|
// This field *must* remain compatible with the Labels field of
|
|
|
|
// Annotations.
|
|
|
|
map<string, string> labels = 2;
|
|
|
|
|
|
|
|
repeated types.Mount mounts = 3 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
// Command to run the the container. The first element is a path to the
|
|
|
|
// executable and the following elements are treated as arguments.
|
|
|
|
//
|
|
|
|
// If command is empty, execution will fall back to the image's entrypoint.
|
|
|
|
//
|
|
|
|
// Command should only be used when overriding entrypoint.
|
|
|
|
repeated string command = 4;
|
|
|
|
|
|
|
|
// Args specifies arguments provided to the image's entrypoint.
|
|
|
|
//
|
|
|
|
// If Command and Args are provided, Args will be appended to Command.
|
|
|
|
repeated string args = 5;
|
|
|
|
|
|
|
|
// Env specifies the environment variables for the container in NAME=VALUE
|
|
|
|
// format. These must be compliant with [IEEE Std
|
|
|
|
// 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html).
|
|
|
|
repeated string env = 6;
|
|
|
|
|
|
|
|
// Dir defines the working directory to set for the container process.
|
|
|
|
string dir = 7;
|
|
|
|
|
|
|
|
// User specifies the user that should be employed to run the container.
|
|
|
|
//
|
|
|
|
// Note that the primary group may be specified by appending the group name
|
|
|
|
// or id to the user name, separated by a `:`. This syntax is
|
|
|
|
// `<user>:<group>`.
|
|
|
|
string user = 8;
|
|
|
|
|
|
|
|
// Groups specifies supplementary groups available to the user.
|
|
|
|
repeated string groups = 9;
|
|
|
|
}
|
|
|
|
|
2016-09-22 18:29:20 +00:00
|
|
|
message Rlimit {
|
|
|
|
string type = 1;
|
|
|
|
uint64 soft = 2;
|
|
|
|
uint64 hard = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message User {
|
|
|
|
uint32 uid = 1;
|
|
|
|
uint32 gid = 2;
|
|
|
|
repeated uint32 additionalGids = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateRequest {
|
|
|
|
string id = 1;
|
|
|
|
string image = 2;
|
|
|
|
repeated string args = 3;
|
|
|
|
repeated string env = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateResponse {
|
|
|
|
Container container = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StartRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StartResponse {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message StopRequest {
|
|
|
|
string id = 1;
|
|
|
|
uint32 signal = 2;
|
|
|
|
uint32 timeout = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StopResponse {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteResponse {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRequest {
|
|
|
|
|
|
|
|
}
|
2016-09-21 03:22:23 +00:00
|
|
|
|
2016-09-22 18:29:20 +00:00
|
|
|
message ListResponse {
|
|
|
|
repeated Container containers = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StateRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StateResponse {
|
|
|
|
Container container = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ExecRequest {
|
|
|
|
string id = 1;
|
|
|
|
bool terminal = 2;
|
|
|
|
User user = 3;
|
|
|
|
repeated string args = 4;
|
|
|
|
repeated string env = 5;
|
|
|
|
string cwd = 6;
|
|
|
|
string pid = 7;
|
|
|
|
repeated string capabilities = 8;
|
|
|
|
string apparmorProfile = 9;
|
|
|
|
string selinuxLabel = 10;
|
|
|
|
bool noNewPrivileges = 11;
|
|
|
|
repeated Rlimit rlimits = 12;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ExecResponse {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateResponse {
|
|
|
|
|
|
|
|
}
|