From d0e6edbe7afbb15abc687371bd7bd0793ff97765 Mon Sep 17 00:00:00 2001 From: Ted Date: Thu, 16 Jun 2022 08:31:30 -0400 Subject: [PATCH 1/2] working dockerfile for mcmap --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a445bc7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:latest + +# ubuntu prompts the user if tzdata is not set ahead of time +ENV TZ=US/Eastern +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# dependencies +RUN apt update && apt install make g++ libpng-dev cmake libspdlog-dev libfmt-dev qtbase5-dev qttools5-dev -y + +# create user +ENV APPUSER=mcmap +RUN groupadd -r $APPUSER && useradd --no-log-init -r -g $APPUSER $APPUSER +RUN mkdir /$APPUSER +RUN mkdir /input && chown $APPUSER:$APPUSER /input +RUN mkdir /output && chown $APPUSER:$APPUSER /output + +# build +COPY . /$APPUSER +RUN cmake -S /$APPUSER -B /$APPUSER/build +RUN make -C /$APPUSER/build -j +RUN ln -s /$APPUSER/build/bin/* /bin/ + +# create a mount point for the minecraft save +VOLUME /input +# create a mount point to dump our image to +VOLUME /output + +USER $APPUSER +ENTRYPOINT ["mcmap"] +CMD ["-file","/output/output.png","/input"] From e7fcac6ddb8d7e37fad7de32ffb0e569baa38c97 Mon Sep 17 00:00:00 2001 From: Ted Date: Sun, 19 Jun 2022 21:28:01 -0400 Subject: [PATCH 2/2] specify build target, removing many dependencies --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a445bc7..9d6b336 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,7 @@ -FROM ubuntu:latest - -# ubuntu prompts the user if tzdata is not set ahead of time -ENV TZ=US/Eastern -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +FROM gcc:latest # dependencies -RUN apt update && apt install make g++ libpng-dev cmake libspdlog-dev libfmt-dev qtbase5-dev qttools5-dev -y +RUN apt update && apt install cmake libspdlog-dev libfmt-dev -y # create user ENV APPUSER=mcmap @@ -17,7 +13,7 @@ RUN mkdir /output && chown $APPUSER:$APPUSER /output # build COPY . /$APPUSER RUN cmake -S /$APPUSER -B /$APPUSER/build -RUN make -C /$APPUSER/build -j +RUN make -C /$APPUSER/build mcmap RUN ln -s /$APPUSER/build/bin/* /bin/ # create a mount point for the minecraft save