未验证 提交 914f10b4 编写于 作者: T Thomas Strömberg 提交者: GitHub

Merge pull request #9149 from tstromberg/docker-no-swap

Disable swap in Docker & podman containers
......@@ -177,9 +177,14 @@ func CreateContainerNode(p CreateParams) error {
if p.OCIBinary == Podman && memcgSwap { // swap is required for memory
runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory))
// Disable swap by setting the value to match
runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory))
}
if p.OCIBinary == Docker { // swap is only required for --memory-swap
if p.OCIBinary == Docker {
runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory))
// Disable swap by setting the value to match
runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory))
}
// https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册