Docker image

Comments

4 comments

  • Obseron Support

    Hey Romain,

    Thanks for the feedback!

    We do not have any plans yet on releasing an Docker image, our priorities at the moment are in developing new and improving old features. We'll put this on the new ideas list though.

    0
    Comment actions Permalink
  • Robin

    Romain,

    Here's what I've got so far. I haven't got the persistent storage setup yet, but it does work.

    There are two stages to building the final container. Here are my two Dockerfiles:

    Dockerfile 1. Build CentOS 7 with systemd - Per https://hub.docker.com/_/centos?tab=description

    FROM centos:7
    ENV container docker
    RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
    systemd-tmpfiles-setup.service ] || rm -f $i; done); \
    rm -f /lib/systemd/system/multi-user.target.wants/*;\
    rm -f /etc/systemd/system/*.wants/*;\
    rm -f /lib/systemd/system/local-fs.target.wants/*; \
    rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
    rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
    rm -f /lib/systemd/system/basic.target.wants/*;\
    rm -f /lib/systemd/system/anaconda.target.wants/*;
    VOLUME [ "/sys/fs/cgroup" ]
    CMD ["/usr/sbin/init"]

     

    Dockerfile 2. Build the Obseron container (without persistent storage):

    FROM centos7-systemd

    MAINTAINER robin@enegren.com

    RUN useradd obseron

    RUN rpm -Uvh http://packages.ksenos.fi/centos/7/x86_64/ksenos-release-0.1-3.noarch.rpm
    RUN yum -y upgrade && yum -y install obseron-daemon lm_sensors epel-release wget && yum -y install smartmontools && yum clean all
    RUN wget http://share.ksenos.fi/webmin-ksenos-1.820-1.noarch.rpm && yum -y localinstall webmin-ksenos-1.820-1.noarch.rpm && rm -rf ./webmin-ksenos-1.820-1.noarch.rpm

    RUN chkconfig webmin off && sed -i "s/^# chkconfig: 235 99 10$/# chkconfig: 235 84 10/g" /etc/init.d/webmin && chkconfig webmin on

    RUN echo obseron soft nofile 10000 >> "/etc/security/limits.conf" && echo obseron hard nofile 10000 >> "/etc/security/limits.conf"

    RUN mkdir -p /var/lib/obseron/{d,e} && chown -R obseron:obseron /var/lib/obseron

    EXPOSE 22 80 443 9191 8554 2525

     

    0
    Comment actions Permalink
  • Romain Favrelle

    Hi Robin,

     

    Thank you very much for that, I'll test it when I get the time !

     

    Best,

    0
    Comment actions Permalink
  • Robin

    Forgot to mention that you need to run CentOS systemd containers with a few added options:

    On Debian-based hosts: sudo docker run -td -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /tmp/$(mktemp -d):/run -p 8888:80 obseron-test

    On Red Hat-based hosts: sudo docker run -td -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 8888:80 obseron-test

    (Also on https://hub.docker.com/_/centos?tab=description )

    0
    Comment actions Permalink

Please sign in to leave a comment.