commit ff0543ddc61455e35294b94acc4b4b5ee5e8f722 Author: Rune Date: Sun Nov 12 17:37:32 2017 +0100 initial upload diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..62e7f5e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM crazymanjinn/zfs-utils + +ENV zfswatcher_package="zfswatcher_0.4.6-1_amd64.deb" \ + zfswatcher_link="https://github.com/rouben/zfswatcher/releases/download/0.4.6/" + +RUN curl -OL ${zfswatcher_link}${zfswatcher_package} && \ + dpkg -i ${zfswatcher_package} && \ + rm ${zfswatcher_package} + +COPY zfswatcher /opt/bin/zfswatcher +ENTRYPOINT ["/opt/bin/zfswatcher"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..8694c7f --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# zfswatcher +Zfswatcher container for monitoring the Zettabyte File System diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..73e4811 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '2' + +services: + zfswatcher: + container_name: zfswatcher + image: pectojin/zfswatcher:latest + build: . + command: /opt/bin/zfswatcher + volumes: + - /etc/zfswatcher:/zfswatcher_config:rw + - /var/log/zfswatcher/zfswatcher.log:/var/log/zfswatcher/zfswatcher.log:rw + - /dev/log:/dev/log:rw + ports: + - 8990:8990 + devices: + - /dev/zfs:/dev/zfs:rw + restart: always diff --git a/zfswatcher b/zfswatcher new file mode 100755 index 0000000..24186d4 --- /dev/null +++ b/zfswatcher @@ -0,0 +1,14 @@ +#!/bin/bash +persist_config_path=/zfswatcher_config/zfswatcher.conf +temp_config_path=/etc/zfs/zfswatcher.conf + +if [[ -s $persist_config_path ]]; then + rm $temp_config_path + ln -s $persist_config_path /etc/zfs/ +elif [[ ( -e $persist_config_path && ! -s $persist_config_path ) || \ + ( ! -e $persist_config_path ) ]]; then + mv $temp_config_path $persist_config_path + ln -s $persist_config_path /etc/zfs +fi + +exec /usr/sbin/zfswatcher \ No newline at end of file