linux - 如何增加 Linux 中 Docker 可用的 CPU 和内存?

标签 linux docker amazon-ec2

当我在我的 Amazon Linux AMI EC2 实例中运行 docker info 时,我得到:

Operating System: Amazon Linux AMI 2017.09
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 993.4MiB

如何增加 docker 可用的 CPU 和内存数量?只有 1 个 CPU,我的 docker 容器立即退出,退出代码为 137(我理解这意味着内存不足)。

我知道如何在我的 Mac Docker 实例上更改这些设置,但不知道如何在 Linux 实例上更改这些设置。

谢谢!

最佳答案

原来我的问题只是我使用的 Amazon t2.micro 实例没有必要的可用 CPU/内存。

升级到具有 2 个 CPU 和 4GB 内存的 t2.medium 并修复了它。

关于linux - 如何增加 Linux 中 Docker 可用的 CPU 和内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48675171/

相关文章:

c++ - IPC Unix消息队列线程安全吗?

c - C 中的示例 linux 服务器对 IE10 没有响应

node.js - 亚马逊 EC2 Ubuntu 实例 : Where should I upload the files to access them from the browser?

python - 使用 boto3 ECS 获取 "Creation of service was not idempotent"。为什么?

ubuntu - 如何在我的系统上拥有类似 Amazon EC2 的环境?

c++ -/usr/bin/C++ 无法使用共享库编译为 gcc

linux - 通过 Proc::Async 执行的命令不是正确的 "tapped"

docker - 运行 docker 容器时无法访问页面

mongodb - Docker为MongoDB ReplicaSet撰写

windows - 尝试在 Windows 中从 Docker 访问 USB 设备