diff --git a/config.go b/config.go index 269e0cbe5..19f423e2b 100644 --- a/config.go +++ b/config.go @@ -1,5 +1,9 @@ package specs +import ( + "encoding/json" +) + // Spec is the base configuration for the container. It specifies platform // independent configuration. type Spec struct { @@ -21,8 +25,8 @@ type Spec struct { type Process struct { // Terminal creates an interactive terminal for the container. Terminal bool `json:"terminal"` - // User specifies user information for the process. - User User `json:"user"` + // User specifies user information for the process. It is a platform-specific structure. + User json.RawMessage `json:"user"` // Args specifies the binary and arguments for the application to execute. Args []string `json:"args"` // Env populates the process environment for the process. diff --git a/config_linux.go b/linux/config.go similarity index 92% rename from config_linux.go rename to linux/config.go index 4bfb78325..5338d7c9a 100644 --- a/config_linux.go +++ b/linux/config.go @@ -1,10 +1,12 @@ -// +build linux +package linux -package specs +import ( + "github.com/opencontainers/specs" +) // LinuxSpec is the full specification for linux containers. type LinuxSpec struct { - Spec + specs.Spec // Linux is platform specific configuration for linux based containers. Linux Linux `json:"linux"` } diff --git a/config-linux.md b/linux/config.md similarity index 100% rename from config-linux.md rename to linux/config.md diff --git a/runtime_config_linux.go b/linux/runtime-config.go similarity index 98% rename from runtime_config_linux.go rename to linux/runtime-config.go index 7ddffdd03..450338546 100644 --- a/runtime_config_linux.go +++ b/linux/runtime-config.go @@ -1,13 +1,17 @@ -package specs +package linux -import "os" +import ( + "os" + + "github.com/opencontainers/specs" +) // LinuxStateDirectory holds the container's state information const LinuxStateDirectory = "/run/opencontainer/containers" // LinuxRuntimeSpec is the full specification for linux containers. type LinuxRuntimeSpec struct { - RuntimeSpec + specs.RuntimeSpec // LinuxRuntime is platform specific configuration for linux based containers. Linux LinuxRuntime `json:"linux"` } diff --git a/runtime-config-linux.md b/linux/runtime-config.md similarity index 100% rename from runtime-config-linux.md rename to linux/runtime-config.md diff --git a/runtime-linux.md b/linux/runtime.md similarity index 100% rename from runtime-linux.md rename to linux/runtime.md