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",
|
||||
"Rev": "142d8fe0150952d52867ac222e3a02eb17916f01"
|
||||
"Rev": "48d211b4bab6028425b0cd34606c974634836986"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/samuel/go-zookeeper/zk",
|
||||
|
|
|
@ -11,28 +11,31 @@ type ContainerConfig struct {
|
|||
Hostname string
|
||||
Domainname string
|
||||
User string
|
||||
Memory int64
|
||||
MemorySwap int64
|
||||
CpuShares int64
|
||||
Cpuset string
|
||||
AttachStdin bool
|
||||
AttachStdout bool
|
||||
AttachStderr bool
|
||||
PortSpecs []string
|
||||
ExposedPorts map[string]struct{}
|
||||
MacAddress string
|
||||
Tty bool
|
||||
OpenStdin bool
|
||||
StdinOnce bool
|
||||
Env []string
|
||||
Cmd []string
|
||||
Image string
|
||||
Labels map[string]string
|
||||
Volumes map[string]struct{}
|
||||
VolumeDriver string
|
||||
WorkingDir string
|
||||
Entrypoint []string
|
||||
NetworkDisabled bool
|
||||
MacAddress 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
|
||||
HostConfig HostConfig
|
||||
|
@ -45,19 +48,39 @@ type HostConfig struct {
|
|||
Memory int64
|
||||
MemorySwap int64
|
||||
CpuShares int64
|
||||
CpuPeriod int64
|
||||
CpusetCpus string
|
||||
CpusetMems string
|
||||
CpuQuota int64
|
||||
BlkioWeight int64
|
||||
OomKillDisable bool
|
||||
Privileged bool
|
||||
PortBindings map[string][]PortBinding
|
||||
Links []string
|
||||
PublishAllPorts bool
|
||||
Dns []string
|
||||
DnsSearch []string
|
||||
ExtraHosts []string
|
||||
VolumesFrom []string
|
||||
SecurityOpt []string
|
||||
Devices []DeviceMapping
|
||||
NetworkMode string
|
||||
IpcMode string
|
||||
PidMode string
|
||||
UTSMode string
|
||||
CapAdd []string
|
||||
CapDrop []string
|
||||
RestartPolicy RestartPolicy
|
||||
SecurityOpt []string
|
||||
ReadonlyRootfs bool
|
||||
Ulimits []Ulimit
|
||||
LogConfig LogConfig
|
||||
CgroupParent string
|
||||
}
|
||||
|
||||
type DeviceMapping struct {
|
||||
PathOnHost string `json:"PathOnHost"`
|
||||
PathInContainer string `json:"PathInContainer"`
|
||||
CgroupPermissions string `json:"CgroupPermissions"`
|
||||
}
|
||||
|
||||
type ExecConfig struct {
|
||||
|
|
|
@ -27,8 +27,38 @@ function teardown() {
|
|||
swarm_manage
|
||||
|
||||
# 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
|
||||
[ -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