Docker image
Hello,
I really dig the Obseron interface and will consider the new community edition to replace my current solution. In order to ease deployment in a "homelab" context and testing in general, an official Docker image (https://hub.docker.com/) would be greatly appreciated !
Thank you very much !
-
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.rpmRUN 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
-
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
Please sign in to leave a comment.
Comments
4 comments