ripe-atlas-software-probe icon indicating copy to clipboard operation
ripe-atlas-software-probe copied to clipboard

Run software probe in a Docker container

Open yoursunny opened this issue 3 years ago • 1 comments

I figured out how to run the software probe inside a Docker container. I'm posting the procedure here in case it's useful for others.

  1. Build the container image with this Dockerfile:

    FROM centos:8
    WORKDIR /root
    RUN echo 'assumeyes=1' >> /etc/yum.conf && \
        yum update && \
        yum install git tar rpm-build openssl-devel autoconf automake libtool make
    RUN git clone --recursive --depth=1 https://github.com/RIPE-NCC/ripe-atlas-software-probe.git && \
        ripe-atlas-software-probe/build-config/centos/bin/make-tars && \
        rpmbuild --bb rpmbuild/SPECS/atlasswprobe.spec && \
        mv rpmbuild/RPMS/x86_64/atlasswprobe-*.rpm ./ && \
        rm -rf ripe-atlas-software-probe rpmbuild
    RUN yum -y install atlasswprobe-*.rpm
    VOLUME /var/atlas-probe/etc
    WORKDIR /var/atlas-probe
    CMD ["/usr/local/atlas/bin/ATLAS"]
    

    Build command is:

    docker build -t atlas-probe .
    
  2. Start the container with this command:

    docker run -d --name atlas-probe \
      --restart always \
      --cpus 0.03 --memory 64M \
      atlas-probe
    
  3. View public key with this command:

    docker exec atlas-probe cat /var/atlas-probe/etc/probe_key.pub
    
  4. To enable IPv6, follow this guide including the docker-ipv6nat step.

The probe connects, and can automatically reconnect using the same SSH key after the host machine reboots. There are a few errors in docker logs atlas-probe, but they seem to be harmless.

yoursunny avatar Jan 03 '21 22:01 yoursunny

Command to build a container from RPM packages:

echo '
FROM centos:7
ADD https://ftp.ripe.net/ripe/atlas/software-probe/centos7/x86_64/atlasswprobe-5020-1.el7.x86_64.rpm /
RUN echo assumeyes=1 >> /etc/yum.conf && \
    yum update && \
    yum -y install /atlasswprobe-*.rpm && \
    rm -rf /var/cache/yum /atlasswprobe-*.rpm
VOLUME /var/atlas-probe/etc
WORKDIR /var/atlas-probe
CMD ["/usr/local/atlas/bin/ATLAS"]
' | docker build -t atlas-probe -

yoursunny avatar Apr 09 '21 02:04 yoursunny