mirror of
https://github.com/sstent/moosefs_docker.git
synced 2026-01-26 09:01:43 +00:00
env vars: size, label; volumes as hdds
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
FROM ubuntu:14.04
|
||||
FROM debian:stretch
|
||||
|
||||
# Install wget, lsb-release and curl
|
||||
RUN apt-get update && apt-get install -y wget lsb-release curl
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y wget lsb-release curl net-tools gnupg2 systemd
|
||||
|
||||
# Add key
|
||||
RUN wget -O - http://ppa.moosefs.com/moosefs.key | apt-key add -
|
||||
RUN . /etc/lsb-release && echo "deb http://ppa.moosefs.com/moosefs-3/apt/ubuntu/$DISTRIB_CODENAME $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/moosefs.list
|
||||
RUN echo "deb http://ppa.moosefs.com/moosefs-3/apt/$(awk -F= '$1=="ID" { print $2 ;}' /etc/os-release)/$(lsb_release -sc) $(lsb_release -sc) main" > /etc/apt/sources.list.d/moosefs.list
|
||||
|
||||
# Install MooseFS chunkserver
|
||||
RUN apt-get update && apt-get install -y moosefs-chunkserver
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
#!/bin/bash
|
||||
cp /etc/mfs/mfschunkserver.cfg.sample /etc/mfs/mfschunkserver.cfg
|
||||
|
||||
mkdir -p /mnt/sdb1
|
||||
chown -R mfs:mfs /mnt/sdb1
|
||||
echo "/mnt/sdb1 10GiB" >> /etc/mfs/mfshdd.cfg
|
||||
mkdir -p /mnt/hdd0
|
||||
chmod -R 777 /mnt/hdd0
|
||||
chown -R mfs:mfs /mnt/hdd0
|
||||
|
||||
ifconfig eth0 | awk '/inet addr/{print substr($2,6)}'
|
||||
#Default size if not set
|
||||
SIZE="${SIZE:- 10}"
|
||||
|
||||
echo "/mnt/hdd0 "$SIZE"GiB" >> /etc/mfs/mfshdd.cfg
|
||||
echo "LABELS=$LABELS" >> /etc/mfs/mfschunkserver.cfg
|
||||
|
||||
sed -i '/# LABELS =/c\LABELS = DOCKER' /etc/mfs/mfschunkserver.cfg
|
||||
sed -i '/MFSCHUNKSERVER_ENABLE=false/c\MFSCHUNKSERVER_ENABLE=true' /etc/default/moosefs-chunkserver
|
||||
mfschunkserver start
|
||||
|
||||
if [[ $1 == "-d" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user