mirror of
https://github.com/sstent/moosefs_docker.git
synced 2025-12-06 08:01:46 +00:00
MooseFS Docker Cluster
This commit is contained in:
18
moosefs-client/Dockerfile
Normal file
18
moosefs-client/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
# Install wget, lsb-release and curl
|
||||
RUN apt-get update && apt-get install -y wget lsb-release curl fuse libfuse2 tree
|
||||
|
||||
# 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
|
||||
|
||||
# Install MooseFS client
|
||||
RUN apt-get update && apt-get install -y moosefs-client
|
||||
|
||||
# Add and run start script
|
||||
ADD start-client.sh /home/start-client.sh
|
||||
RUN chown root:root /home/start-client.sh
|
||||
RUN chmod 700 /home/start-client.sh
|
||||
|
||||
CMD ["/home/start-client.sh", "-bash"]
|
||||
23
moosefs-client/start-client.sh
Normal file
23
moosefs-client/start-client.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# wait for mfsmaster startup
|
||||
ping -c 10 mfsmaster
|
||||
|
||||
mkdir -p /mnt/mfs
|
||||
|
||||
# mount mfs
|
||||
mfsmount /mnt/mfs -H mfsmaster
|
||||
|
||||
# create example file to MooseFS
|
||||
echo "If you can find this file in /mnt/mfs/ on your client machine - it means MooseFS is working correctly, congratulations!" > /mnt/mfs/welcome_to_moosefs.txt
|
||||
|
||||
# list files in MooseFS
|
||||
ls /mnt/mfs/
|
||||
|
||||
if [[ $1 == "-d" ]]; then
|
||||
while true; do sleep 1000; done
|
||||
fi
|
||||
|
||||
if [[ $1 == "-bash" ]]; then
|
||||
/bin/bash
|
||||
fi
|
||||
Reference in New Issue
Block a user