initial upload

This commit is contained in:
Rune
2017-11-12 17:37:32 +01:00
commit ff0543ddc6
4 changed files with 44 additions and 0 deletions

11
Dockerfile Normal file
View File

@@ -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"]

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# zfswatcher
Zfswatcher container for monitoring the Zettabyte File System

17
docker-compose.yml Normal file
View File

@@ -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

14
zfswatcher Executable file
View File

@@ -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