如何在 debian wheezy docker 映像上安装 pgrep/pkill
How to install pgrep/pkill on debian wheezy docker image
基础中没有pkill/pgrepdebian:wheezydocker图片
# docker run debian:wheezy pkill
System error: exec: "pkill": executable file not found in $PATH
我不知道我应该安装哪个包来获得这些工具
# docker run debian:wheezy cat /etc/apt/sources.list
deb http://httpredir.debian.org/debian wheezy main
deb http://httpredir.debian.org/debian wheezy-updates main
deb http://security.debian.org wheezy/updates main
# docker run debian:wheezy apt-get install procps
E: Unable to locate package procps
您可以 运行 bash 亲自看看:
$ docker run --rm -it debian:wheezy bash
从这里您可以使用 apt-get 或 aptitude 并搜索包。我找不到 pkill(它是 Unix 命令而不是 GNU/Linux 吗?)但我猜你可以同时使用 grep
和 kill
来获得相同的效果。
尝试在您的 Dockerfile 或您的容器中安装 procps,然后提交并启动新映像
已解决。我忘了
apt-get update
之前
apt-get install procps
在容器中
基础中没有pkill/pgrepdebian:wheezydocker图片
# docker run debian:wheezy pkill
System error: exec: "pkill": executable file not found in $PATH
我不知道我应该安装哪个包来获得这些工具
# docker run debian:wheezy cat /etc/apt/sources.list
deb http://httpredir.debian.org/debian wheezy main
deb http://httpredir.debian.org/debian wheezy-updates main
deb http://security.debian.org wheezy/updates main
# docker run debian:wheezy apt-get install procps
E: Unable to locate package procps
您可以 运行 bash 亲自看看:
$ docker run --rm -it debian:wheezy bash
从这里您可以使用 apt-get 或 aptitude 并搜索包。我找不到 pkill(它是 Unix 命令而不是 GNU/Linux 吗?)但我猜你可以同时使用 grep
和 kill
来获得相同的效果。
尝试在您的 Dockerfile 或您的容器中安装 procps,然后提交并启动新映像
已解决。我忘了
apt-get update
之前
apt-get install procps
在容器中