mirror of https://github.com/docker/docs.git
set MemorySwappiness default value
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
This commit is contained in:
parent
0bd250bcf0
commit
63498b1a80
|
@ -414,8 +414,12 @@ func getContainerJSON(c *context, w http.ResponseWriter, r *http.Request) {
|
||||||
func postContainersCreate(c *context, w http.ResponseWriter, r *http.Request) {
|
func postContainersCreate(c *context, w http.ResponseWriter, r *http.Request) {
|
||||||
r.ParseForm()
|
r.ParseForm()
|
||||||
var (
|
var (
|
||||||
config dockerclient.ContainerConfig
|
config = dockerclient.ContainerConfig{
|
||||||
name = r.Form.Get("name")
|
HostConfig: dockerclient.HostConfig{
|
||||||
|
MemorySwappiness: -1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
name = r.Form.Get("name")
|
||||||
)
|
)
|
||||||
|
|
||||||
if err := json.NewDecoder(r.Body).Decode(&config); err != nil {
|
if err := json.NewDecoder(r.Body).Decode(&config); err != nil {
|
||||||
|
|
|
@ -18,4 +18,17 @@ function teardown() {
|
||||||
[ "${#lines[@]}" -eq 2 ]
|
[ "${#lines[@]}" -eq 2 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "docker-compose up - check memory swappiness" {
|
||||||
|
start_docker_with_busybox 2
|
||||||
|
swarm_manage
|
||||||
|
FILE=$TESTDATA/compose/simple.yml
|
||||||
|
|
||||||
|
docker-compose_swarm -f $FILE up -d
|
||||||
|
|
||||||
|
run docker_swarm ps -q
|
||||||
|
[ "${#lines[@]}" -eq 2 ]
|
||||||
|
|
||||||
|
run docker_swarm inspect compose_service1_1
|
||||||
|
# check memory-swappiness
|
||||||
|
[[ "${output}" == *"\"MemorySwappiness\": -1"* ]]
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue