From 294fcc89762a47a166947dc8d3d4360713ba21dc Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sun, 13 May 2018 16:58:34 +0000 Subject: [PATCH] Set mFi to initialize on first run with empty data dir --- Dockerfile | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7f8fbbf..210cc95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,18 +5,30 @@ RUN apt-get update \ && apt-get -y dist-upgrade \ && apt-get -y install --no-install-recommends \ - wget jsvc mongodb-server binutils unzip \ + wget jsvc mongodb-server binutils procps unzip \ && apt-get -y clean \ && rm -Rf /var/lib/apt/lists/* RUN cd /tmp \ && wget "http://dl.ubnt.com/mfi/${MFI_VERSION}/mFi.unix.zip" \ && unzip mFi.unix.zip \ - && mv /tmp/mFi /usr/lib/mfi + && rm mFi.unix.zip \ + && mv /tmp/mFi /usr/lib/mfi \ + && cp -Rf /usr/lib/mfi/data /usr/lib/mfi/data-orig \ + && groupadd -r -g 500 mfi \ + && useradd -r -d /usr/lib/mfi -u 500 -g 500 mfi \ + && mkdir -p /var/lib/mfi \ + && chown -Rf mfi:mfi /usr/lib/mfi /var/lib/mfi EXPOSE 6080 6443 VOLUME /usr/lib/mfi/data WORKDIR /var/lib/mfi -CMD ["/usr/bin/java", "-Xmx1024M", "-jar", "/usr/lib/mfi/lib/ace.jar", "start"] +COPY run.sh /run.sh +CMD /run.sh + +USER mfi + +HEALTHCHECK --start-period=3m CMD wget -q -O /dev/null --no-check-certificate \ + https://127.0.0.1:6443/login -- Gitblit v1.9.1