Install on Docker

There are a few variations on how to install the Ardexa agent inside a docker container (depending on your use case), but in this article we will be focusing on building a single use container that behaves just like a Linux Machine.

Step 1: Create a new device

  • Open the Ardexa Web UI, browse to the Devices tab and click New Device

  • Give the new device a name, select Linux 64 bit (x86_64), and then click Create

  • Download and unizp the agentPack

  • Copy the deb file into the same directory as the Dockerfile (see below)

  • Note down the agent version listed in the deb filename

  • Rename the deb file to simply ardexa.deb

Step 2: Create the Docker image

Add the following content to your Dockerfile.

FROM debian:buster

ENV container docker

COPY ardexa.deb /

RUN apt-get update \
 && apt-get install -y procps unzip systemd lsb-base \
    python3 python3-pip nmap arp-scan wget \
 && apt-get install -y --no-install-recommends at \
 && rm -f /sbin/init \
 && ln -sf ../lib/systemd/systemd /sbin/init \
 && dpkg -i /ardexa.deb

RUN systemctl enable ardexa

STOPSIGNAL SIGRTMIN+3

CMD ["/sbin/init"]

VOLUME ["/etc/ardexa", "/opt/ardexa/logs"]

Then build the image. We recommend giving the image the same name as Step 1 and tagging it with the agent version.

docker build -t ardexa_docker_agent:2.4.2 .

Step 3: Launch the container

To allow systemd to run successfully inside a container, it needs some special treatment. We also want the container to run in the background and keep running even if we reboot the machine. The following docker command will launch the container with all the necessary privileges and flags.

docker run --restart unless-stopped -d --name ardexa_docker_agent --privileged \
  --tmpfs /tmp --tmpfs /run --tmpfs /run/lock \
  -v /sys/fs/cgroup:/sys/fs/cgroup:ro ardexa_docker_agent:2.4.2

Step 4: Data collection

Now that your agent container is up and running, you can focus on data collection. Given that this is somewhat unique to every use case, we encourage you to reach out to your account manager for suggestions on how best to meet your needs.

Last updated