From 908059a6f5db3fd381727b6f9896d75df257dc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=B6n?= Date: Tue, 7 Jun 2022 14:53:16 +0200 Subject: [PATCH 1/2] changed baseimage to alpine; exposed intel amt port (4433) --- docker/Dockerfile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 163ddf49..69b39106 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,5 @@ -# Filename: Dockerfile +FROM node:current-alpine -FROM node:slim #Add non-root user, add installation directories and assign proper permissions RUN mkdir -p /opt/meshcentral @@ -8,15 +7,7 @@ RUN mkdir -p /opt/meshcentral # meshcentral installation WORKDIR /opt/meshcentral -# add mongodb repository to apt -RUN apt-get update && apt-get install -y gnupg2 wget -RUN wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - -RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list - -# install mongodb -RUN apt-get update \ - && apt-get install -y mongodb-org-tools \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache bash RUN mkdir /opt/meshcentral/meshcentral COPY ./ /opt/meshcentral/meshcentral/ @@ -38,7 +29,7 @@ RUN cd meshcentral/translate && node translate.js minifyall RUN cd meshcentral/translate && node translate.js translateall RUN cd meshcentral/translate && node translate.js extractall -EXPOSE 80 443 +EXPOSE 80 443 4433 # volumes VOLUME /opt/meshcentral/meshcentral-data From 0b11aa93922b814ff8f843475f58d5213f987845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=B6n?= Date: Tue, 7 Jun 2022 14:56:02 +0200 Subject: [PATCH 2/2] changed installation of mongodb-tools to optional --- docker/Dockerfile | 2 ++ docker/readme.md | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 69b39106..9245f270 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,6 @@ FROM node:current-alpine +ARG INCLUDE_MONGODBTOOLS="" #Add non-root user, add installation directories and assign proper permissions RUN mkdir -p /opt/meshcentral @@ -8,6 +9,7 @@ RUN mkdir -p /opt/meshcentral WORKDIR /opt/meshcentral RUN apk add --no-cache bash +RUN if [ "$INCLUDE_MONGODBTOOLS" == "yes" ] || [ "$INCLUDE_MONGODBTOOLS" == "YES" ]; then apk add --no-cache mongodb-tools; fi RUN mkdir /opt/meshcentral/meshcentral COPY ./ /opt/meshcentral/meshcentral/ diff --git a/docker/readme.md b/docker/readme.md index 485e63b5..07a8c466 100644 --- a/docker/readme.md +++ b/docker/readme.md @@ -7,6 +7,9 @@ > docker build -f docker/Dockerfile --force-rm -t meshcentral . +# alternative, if you want to include the mongodb-tools (mongodump, ...), you can add the 'INCLUDE_MONGODBTOOLS=yes' build argument +> docker build -f docker/Dockerfile --force-rm --build-arg INCLUDE_MONGODBTOOLS=yes -t meshcentral . + # (optional) cleanup after docker build: > cd .. > rm -rf MeshCentral/