File tree Expand file tree Collapse file tree 9 files changed +85
-8
lines changed
Expand file tree Collapse file tree 9 files changed +85
-8
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ RUN apt-get update && apt-get install -y moosefs-cgi moosefs-cgiserv moosefs-cli
1313# Expose ports master ports
1414EXPOSE 9425
1515
16- CMD ["mfscgiserv" , "-f" ]
16+ # Add start script
17+ ADD cgiserver.sh /usr/sbin/cgiserver.sh
18+ RUN chown root:root /usr/sbin/cgiserver.sh ; chmod 700 /usr/sbin/cgiserver.sh
19+
20+ CMD ["cgiserver.sh" ]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ CMD=" mfscgiserv -f"
4+
5+ # Add host if set
6+ if [ ! -z ${MASTER_HOST+X} ];
7+ then
8+ CMD=" $CMD -H $MASTER_HOST "
9+ fi
10+
11+ # Add host if set
12+ if [ ! -z ${MASTER_PORT+X} ];
13+ then
14+ CMD=" $CMD -P $MASTER_PORT "
15+ fi
16+
17+ exec $CMD
Original file line number Diff line number Diff line change 11FROM debian:buster
22
33# Install wget, lsb-release and curl
4- RUN apt-get update && apt-get install -y wget gnupg2
4+ RUN apt-get update && apt-get install -y wget gnupg2 gettext-base
55
66# Add key
77RUN wget -O - http://ppa.moosefs.com/moosefs.key 2>/dev/null | apt-key add - 2>/dev/null
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ mkdir -p /mnt/hdd0/mfs
34# Set correct owner
4- chown -R mfs:mfs /mnt/hdd0 /var/lib/mfs
5+ chown -R mfs:mfs /mnt/hdd0 /mnt/hdd0/mfs / var/lib/mfs
56
6- # Add size to hdd is defined
7+ # Overwrite mfschunkserver.cfg if passed in
8+ # this will base64 decode MFS_CHUNKSERVER_CONFIG variable text
9+ # substitute any env variables in decoded text
10+ # save text into /etc/mfs/mfschunkserver.cfg
11+ if [ ! -z ${MFS_CHUNKSERVER_CONFIG+X} ];
12+ then
13+ echo $MFS_CHUNKSERVER_CONFIG | base64 -d | envsubst > /etc/mfs/mfschunkserver.cfg
14+ fi
15+
16+ # Overwrite mfshdd.cfg if passed in
17+ # this will base64 decode MFS_HDD_CONFIG variable text
18+ # substitute any env variables in decoded text
19+ # save text into /etc/mfs/mfshdd.cfg
20+ if [ ! -z ${MFS_HDD_CONFIG+X} ];
21+ then
22+ echo $MFS_HDD_CONFIG | base64 -d | envsubst > /etc/mfs/mfshdd.cfg
23+ fi
24+
25+
26+ # Add size to hdd if defined
727if [ -z ${SIZE+X} ];
828 then
929 echo " /mnt/hdd0" > /etc/mfs/mfshdd.cfg
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ RUN echo "deb http://ppa.moosefs.com/3.0.115/apt/debian/buster buster main" > /e
1010# Install MooseFS client and cli
1111RUN apt-get update && apt-get install -y moosefs-client moosefs-cli
1212
13- # Make a moosefs mountpoint
14- RUN mkdir -p /mnt/moosefs
13+ # Add start script
14+ ADD mount.sh /usr/sbin/mount.sh
15+ RUN chown root:root /usr/sbin/mount.sh ; chmod 700 /usr/sbin/mount.sh ; mkdir -p /mnt/moosefs
1516
16- CMD ["mfsmount" , "-f" , "/mnt/moosefs " ]
17+ CMD ["mount.sh " ]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ CMD=" mfsmount /mnt/moosefs -f"
4+
5+ # Add host if set
6+ if [ ! -z ${MASTER_HOST+X} ];
7+ then
8+ CMD=" $CMD -H $MASTER_HOST "
9+ fi
10+
11+ # Add host if set
12+ if [ ! -z ${MASTER_PORT+X} ];
13+ then
14+ CMD=" $CMD -P $MASTER_PORT "
15+ fi
16+
17+ exec $CMD
Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ MFS_ENV="${MFS_ENV:-PROD}"
66# Set correct owner
77chown -R mfs:mfs /var/lib/mfs
88
9+ # Overwrite mfsmaster.cfg if passed in
10+ # this will base64 decode MFS_MASTER_CONFIG variable text
11+ # substitute any env variables in decoded text
12+ # save text into /etc/mfs/mfsmaster.cfg
13+ if [ ! -z ${MFS_MASTER_CONFIG+X} ];
14+ then
15+ echo $MFS_MASTER_CONFIG | base64 -d | envsubst > /etc/mfs/mfsmaster.cfg
16+ fi
17+
918# We have to be sure that we have metadata files
1019if [ -f /var/lib/mfs/metadata.mfs ];
1120then
Original file line number Diff line number Diff line change 11FROM debian:buster
22
33# Install wget and gnupg2
4- RUN apt-get update && apt-get install -y wget gnupg2
4+ RUN apt-get update && apt-get install -y wget gnupg2 gettext-base
55
66# Add key
77RUN wget -O - http://ppa.moosefs.com/moosefs.key 2>/dev/null | apt-key add - 2>/dev/null
Original file line number Diff line number Diff line change @@ -6,5 +6,14 @@ MFS_ENV="${MFS_ENV:-PROD}"
66# Set a correct owner
77chown -R mfs:mfs /var/lib/mfs
88
9+ # Overwrite mfsmetalogger.cfg if passed in
10+ # this will base64 decode MFS_METALOGGER_CONFIG variable text
11+ # substitute any env variables in decoded text
12+ # save text into /etc/mfs/mfsmetalogger.cfg
13+ if [ ! -z ${MFS_METALOGGER_CONFIG+X} ];
14+ then
15+ echo $MFS_METALOGGER_CONFIG | base64 -d | envsubst > /etc/mfs/mfsmetalogger.cfg
16+ fi
17+
918# Run
1019exec mfsmetalogger -f
You can’t perform that action at this time.
0 commit comments