How Do You Install Sysdig in a New Docker Container to Try It Out?

Problem scenario
You want to monitor Docker containers.  Therefore you want to install Sysdig to try it out.  How do you pull down a Docker container that has Sysdig installed in it?

Solution

Prerequisites
Docker needs to be installed.  If you need to install Docker on a CentOS/RedHat/Fedora distribution, see this posting.  If you need to install Docker on a Debian/Ubuntu, see this posting.  If you need to install Docker on a Linux SUSE, see this posting.  The Docker service needs to be running.

Procedures
1.  If your server (the Docker host) is using a Debian/Ubuntu distribution, run this command:
sudo apt-get -y install linux-headers-$(uname -r)

If your server (Docker host) is using a CentOS/RedHat/Fedora distribution, run this command:
sudo yum -y install kernel-devel-$(uname -r)

2.  Be advised that it is not recommended to use --privileged and docker.sock in the way that this step describes.  This is for testing purposes in a non-production environment.  The Docker host should otherwise be secure, and you should not have sensitive data on it. 

To test out Sysdig, run these two commands:
docker pull sysdig/sysdig

docker run -i -t --name sysdig --privileged -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro sysdig/sysdig

Leave a comment

Your email address will not be published. Required fields are marked *