2018-05-13 | Jacek Kowalski | |
2018-05-13 | Jacek Kowalski | |
2018-05-13 | Jacek Kowalski |
Dockerfile | ●●●●● patch | view | raw | blame | history | |
README.md | ●●●●● patch | view | raw | blame | history | |
run.sh | ●●●●● patch | view | raw | blame | history |
Dockerfile
@@ -1,21 +1,34 @@ FROM debian MAINTAINER Jacek Kowalski <Jacek@jacekk.info> FROM openjdk:7-jre-slim ENV MFI_VERSION 2.1.11 RUN apt-get update \ && apt-get -y dist-upgrade \ && apt-get -y install wget jsvc openjdk-7-jre-headless mongodb-server binutils unzip \ && apt-get -y clean && apt-get -y install --no-install-recommends \ 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 README.md
New file @@ -0,0 +1,67 @@ # mFi This is a Docker image of mFi Controller (https://www.ubnt.com/download/mfi/default/default/mfiunixzip) based on `openjdk:7-jre-slim`. ## Disk space requirements mFi requires significant amount of storage - 3 GB just for starters. Secure appropriate disk space and configure data retention. ## Usage ```bash docker run -d --name=mfi \ -p 6080:6080 -p 6443:6443 \ jacekkow/mfi ``` First run wizard should be available at https://127.0.0.1:6443/ (note that self-signed certificate is used). By default container uses Docker data volume for persistence. You can update such installation by passing `--volumes-from` option to `docker run`: ```bash docker pull jacekkow/mfi docker stop mfi docker rename mfi mfi-old docker run -d --name=mfi \ -p 6080:6080 -p 6443:6443 \ --volumes-from mfi-old \ jacekkow/mfi docker rm -v mfi-old ``` ## Local storage If you prefer to have direct access to container's data from the host, you can use local storage instead of data volumes: ```bash docker run -d --name=mfi \ -p 6080:6080 -p 6443:6443 \ -v /srv/mfi:/usr/lib/mfi/data \ jacekkow/mfi ``` `/usr/lib/mfi/data` will be automatically populated with default configuration if necessary. File ownership is recursively changed to `mfi:mfi` (`500:500`) on each start. ## Configuration By default the JVM is started with options `-Xmx1024m`. You can override this default using `JAVA_OPTS` environment variable: ```bash docker run -d --name=mfi \ -p 6080:6080 -p 6443:6443 \ -e "JAVA_OPTS=-Xmx2048m" \ jacekkow/mfi ``` run.sh
New file @@ -0,0 +1,17 @@ #!/bin/bash if [ -z "$JAVA_OPTS" ]; then JAVA_OPTS="-Xmx1024m" fi if [ ! -f /usr/lib/mfi/data/system.properties ]; then cp -Rf /usr/lib/mfi/data-orig/. /usr/lib/mfi/data/ fi if [ `id -u` -eq 0 ]; then chown -Rf mfi:mfi /usr/lib/mfi/data exec sudo -u mfi java $JAVA_OPTS -jar /usr/lib/mfi/lib/ace.jar start else exec java $JAVA_OPTS -jar /usr/lib/mfi/lib/ace.jar start fi