mirror of https://github.com/docker/docs.git
refresh config fields
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com> Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
2999809358
commit
2389760e95
|
@ -106,7 +106,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/samalba/dockerclient",
|
"ImportPath": "github.com/samalba/dockerclient",
|
||||||
"Rev": "142d8fe0150952d52867ac222e3a02eb17916f01"
|
"Rev": "48d211b4bab6028425b0cd34606c974634836986"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/samuel/go-zookeeper/zk",
|
"ImportPath": "github.com/samuel/go-zookeeper/zk",
|
||||||
|
|
|
@ -11,28 +11,31 @@ type ContainerConfig struct {
|
||||||
Hostname string
|
Hostname string
|
||||||
Domainname string
|
Domainname string
|
||||||
User string
|
User string
|
||||||
Memory int64
|
|
||||||
MemorySwap int64
|
|
||||||
CpuShares int64
|
|
||||||
Cpuset string
|
|
||||||
AttachStdin bool
|
AttachStdin bool
|
||||||
AttachStdout bool
|
AttachStdout bool
|
||||||
AttachStderr bool
|
AttachStderr bool
|
||||||
PortSpecs []string
|
|
||||||
ExposedPorts map[string]struct{}
|
ExposedPorts map[string]struct{}
|
||||||
MacAddress string
|
|
||||||
Tty bool
|
Tty bool
|
||||||
OpenStdin bool
|
OpenStdin bool
|
||||||
StdinOnce bool
|
StdinOnce bool
|
||||||
Env []string
|
Env []string
|
||||||
Cmd []string
|
Cmd []string
|
||||||
Image string
|
Image string
|
||||||
Labels map[string]string
|
|
||||||
Volumes map[string]struct{}
|
Volumes map[string]struct{}
|
||||||
|
VolumeDriver string
|
||||||
WorkingDir string
|
WorkingDir string
|
||||||
Entrypoint []string
|
Entrypoint []string
|
||||||
NetworkDisabled bool
|
NetworkDisabled bool
|
||||||
|
MacAddress string
|
||||||
OnBuild []string
|
OnBuild []string
|
||||||
|
Labels map[string]string
|
||||||
|
|
||||||
|
// FIXME: Compatibility
|
||||||
|
Memory int64
|
||||||
|
MemorySwap int64
|
||||||
|
CpuShares int64
|
||||||
|
Cpuset string
|
||||||
|
PortSpecs []string
|
||||||
|
|
||||||
// This is used only by the create command
|
// This is used only by the create command
|
||||||
HostConfig HostConfig
|
HostConfig HostConfig
|
||||||
|
@ -45,19 +48,39 @@ type HostConfig struct {
|
||||||
Memory int64
|
Memory int64
|
||||||
MemorySwap int64
|
MemorySwap int64
|
||||||
CpuShares int64
|
CpuShares int64
|
||||||
|
CpuPeriod int64
|
||||||
CpusetCpus string
|
CpusetCpus string
|
||||||
|
CpusetMems string
|
||||||
|
CpuQuota int64
|
||||||
|
BlkioWeight int64
|
||||||
|
OomKillDisable bool
|
||||||
Privileged bool
|
Privileged bool
|
||||||
PortBindings map[string][]PortBinding
|
PortBindings map[string][]PortBinding
|
||||||
Links []string
|
Links []string
|
||||||
PublishAllPorts bool
|
PublishAllPorts bool
|
||||||
Dns []string
|
Dns []string
|
||||||
DnsSearch []string
|
DnsSearch []string
|
||||||
|
ExtraHosts []string
|
||||||
VolumesFrom []string
|
VolumesFrom []string
|
||||||
SecurityOpt []string
|
Devices []DeviceMapping
|
||||||
NetworkMode string
|
NetworkMode string
|
||||||
|
IpcMode string
|
||||||
|
PidMode string
|
||||||
|
UTSMode string
|
||||||
|
CapAdd []string
|
||||||
|
CapDrop []string
|
||||||
RestartPolicy RestartPolicy
|
RestartPolicy RestartPolicy
|
||||||
|
SecurityOpt []string
|
||||||
|
ReadonlyRootfs bool
|
||||||
Ulimits []Ulimit
|
Ulimits []Ulimit
|
||||||
LogConfig LogConfig
|
LogConfig LogConfig
|
||||||
|
CgroupParent string
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeviceMapping struct {
|
||||||
|
PathOnHost string `json:"PathOnHost"`
|
||||||
|
PathInContainer string `json:"PathInContainer"`
|
||||||
|
CgroupPermissions string `json:"CgroupPermissions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExecConfig struct {
|
type ExecConfig struct {
|
||||||
|
|
|
@ -27,8 +27,38 @@ function teardown() {
|
||||||
swarm_manage
|
swarm_manage
|
||||||
|
|
||||||
# run
|
# run
|
||||||
docker_swarm run -d --name test_container -c 1 busybox sleep 100
|
docker_swarm run -d --name test_container \
|
||||||
|
--add-host=host-test:127.0.0.1 \
|
||||||
|
--cap-add=NET_ADMIN \
|
||||||
|
--cap-drop=MKNOD \
|
||||||
|
--label=com.example.version=1.0 \
|
||||||
|
--read-only=true \
|
||||||
|
--ulimit=nofile=10 \
|
||||||
|
--device=/dev/loop0:/dev/loop0 \
|
||||||
|
--ipc=host \
|
||||||
|
--pid=host \
|
||||||
|
busybox sleep 1000
|
||||||
|
|
||||||
# verify, container is running
|
# verify, container is running
|
||||||
[ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ]
|
[ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ]
|
||||||
|
|
||||||
|
run docker_swarm inspect test_container
|
||||||
|
# label
|
||||||
|
[[ "${output}" == *"com.example.version"* ]]
|
||||||
|
# add-host
|
||||||
|
[[ "${output}" == *"host-test:127.0.0.1"* ]]
|
||||||
|
# cap-add
|
||||||
|
[[ "${output}" == *"NET_ADMIN"* ]]
|
||||||
|
# cap-drop
|
||||||
|
[[ "${output}" == *"MKNOD"* ]]
|
||||||
|
# read-only
|
||||||
|
[[ "${output}" == *"\"ReadonlyRootfs\": true"* ]]
|
||||||
|
# ulimit
|
||||||
|
[[ "${output}" == *"nofile"* ]]
|
||||||
|
# device
|
||||||
|
[[ "${output}" == *"/dev/loop0"* ]]
|
||||||
|
# ipc
|
||||||
|
[[ "${output}" == *"\"IpcMode\": \"host\""* ]]
|
||||||
|
# pid
|
||||||
|
[[ "${output}" == *"\"PidMode\": \"host\""* ]]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue