From 471105b30775102b08d34a150793d6c3be670772 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Tue, 6 Feb 2024 17:54:31 -0500 Subject: [PATCH 1/3] Add Dockerfile --- .dockerignore | 4 ++++ Dockerfile | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..781756e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.gitignore +.dockerignore +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75cfebb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM docker.io/library/python:2.7.18-slim-buster AS installer + +RUN ln -s $(which python) /usr/bin/python + +WORKDIR /app +COPY installer installer +RUN yes '' | ./installer/malpem-install + +ENV PATH=/opt/malpem-1.3/bin:$PATH \ + PYTHONPATH=/opt/malpem-1.3/lib/care/rootfs/usr/lib/python2.7/dist-packages:$PYTHONPATH + +CMD ["/opt/malpem-1.3/bin/malpem"] From 5891036e763a93dbdf48d6e5187ba0eb3ce8dea9 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Wed, 7 Feb 2024 09:29:14 -0500 Subject: [PATCH 2/3] Install libgl and remove PYTHONPATH --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 75cfebb..9eed420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,14 @@ WORKDIR /app COPY installer installer RUN yes '' | ./installer/malpem-install -ENV PATH=/opt/malpem-1.3/bin:$PATH \ - PYTHONPATH=/opt/malpem-1.3/lib/care/rootfs/usr/lib/python2.7/dist-packages:$PYTHONPATH +# it'd be a better practice to put apt-get before malpem-install +# locate and updatedb are for the malpem-proot wrapper script +RUN apt-get update \ + && apt-get install -y locate libgl1-mesa-glx \ + && apt-get clean autoclean \ + && rm -rf /var/lib/apt/lists/* \ + && updatedb -CMD ["/opt/malpem-1.3/bin/malpem"] +ENV PATH=/opt/malpem-1.3/bin:$PATH + +CMD ["/opt/malpem-1.3/bin/malpem-proot"] From 76ba0ddc8b68c20c9c76eab63b001833c7eea419 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Wed, 7 Feb 2024 13:20:20 -0500 Subject: [PATCH 3/3] Reorder apt-get --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9eed420..ce47a76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,17 @@ FROM docker.io/library/python:2.7.18-slim-buster AS installer -RUN ln -s $(which python) /usr/bin/python +RUN apt-get update \ + && apt-get install -y locate libgl1-mesa-glx \ + && apt-get clean autoclean \ + && rm -rf /var/lib/apt/lists/* \ + && updatedb WORKDIR /app COPY installer installer -RUN yes '' | ./installer/malpem-install +RUN yes '' | python installer/malpem-install # it'd be a better practice to put apt-get before malpem-install # locate and updatedb are for the malpem-proot wrapper script -RUN apt-get update \ - && apt-get install -y locate libgl1-mesa-glx \ - && apt-get clean autoclean \ - && rm -rf /var/lib/apt/lists/* \ - && updatedb ENV PATH=/opt/malpem-1.3/bin:$PATH