My goal is to use perf
to run performance tests on some Docker images. By default, the images I'm using don't come with perf
. As such, I tried
apt-get update
apt-get install linux-tools-generic
to get perf, but I got
E: Unable to locate package linux-tools-generic
I asked on SO, and was told that my sources.list
might not be set up properly, and was also sent here because my confusion better pertains to SF.
Any advice on how I can get/run perf
inside various Docker containers?
apt-get -qq update && apt-get -qq install linux-tools-generic
не сработало, у меня есть другое решение.Я сделал
apt-get update
apt-get install linux-tools
, который, как я понял, дал мне perf_4.9. Позже будет мягкая ссылка, perf
теперь работает внутри контейнера докеров. Это не зависит от ядра, но работает для того, что мне нужно (пока).
centos
:
[alexus@wcmisdlin02 ~]$ docker run -it centos
[root@ae6c1eb43a15 /]# yum --assumeyes --quiet install perf
warning: /var/cache/yum/x86_64/7/base/packages/numactl-libs-2.0.9-7.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for numactl-libs-2.0.9-7.el7.x86_64.rpm is not installed
Public key for perf-3.10.0-862.3.3.el7.x86_64.rpm is not installed
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-5.1804.el7.centos.2.x86_64 (@Updates)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@ae6c1eb43a15 /]# perf --version
perf version 3.10.0-862.3.3.el7.x86_64.debug
[root@ae6c1eb43a15 /]#
ubuntu
:
[alexus@wcmisdlin02 ~]$ docker run -it ubuntu bash
root@98214d8d539f:/#
root@98214d8d539f:/# apt-get -qq update && apt-get -qq install linux-tools-generic
.....
root@98214d8d539f:/# perf