shithub: purgatorio

Download patch

ref: fb7dd4b3a868cb8987049c95bb32e6425a73c8b9
parent: babf901b4a508c3ec5d1f89655f10377bbdf9637
author: henesy <devnull@localhost>
date: Wed Apr 8 10:35:41 EDT 2020

Update docker file (thanks aeggy)

- Switch to debian buster i386
- Use busybox

--- a/.dockerignore
+++ b/.dockerignore
@@ -1,3 +1,5 @@
+Dockerfile
+.dockerignore
 .git
 .hg*
 
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,32 +1,28 @@
-FROM i386/ubuntu:devel
+ARG CONF=emu
 
+FROM i386/debian:buster-slim AS build
+ARG CONF
 RUN apt-get -y update
 RUN apt-get install -y libx11-dev \
 	libxext-dev \
-	libc6-dev \
+	linux-libc-dev \
 	gcc
 
-# if on i386 there's no need for multilib
-#RUN apt-get install -y libc6-dev-i386
-#RUN apt-get install -y libx11-6:i386, libxext-dev:i386
-#RUN apt-get install -y gcc-multilib
-
 ENV INFERNO=/usr/inferno
 COPY . $INFERNO
 WORKDIR $INFERNO
 
 # setup a custom mkconfig
-RUN echo > mkconfig ROOT=$INFERNO
-RUN echo >>mkconfig TKSTYLE=std
-RUN echo >>mkconfig CONF=emu
-RUN echo >>mkconfig SYSHOST=Linux
-RUN echo >>mkconfig SYSTARG=Linux
-RUN echo >>mkconfig OBJTYPE=386
+RUN echo > mkconfig ROOT=$INFERNO; \
+echo >>mkconfig TKSTYLE=std; \
+echo >>mkconfig CONF=${CONF}; \
+echo >>mkconfig SYSHOST=Linux; \
+echo >>mkconfig SYSTARG=Linux; \
+echo >>mkconfig OBJTYPE=386; \
+echo >>mkconfig 'OBJDIR=$SYSTARG/$OBJTYPE'; \
+echo >>mkconfig '<$ROOT/mkfiles/mkhost-$SYSHOST'; \
+echo >>mkconfig '<$ROOT/mkfiles/mkfile-$SYSTARG-$OBJTYPE'
 
-RUN echo >>mkconfig 'OBJDIR=$SYSTARG/$OBJTYPE'
-RUN echo >>mkconfig '<$ROOT/mkfiles/mkhost-$SYSHOST'
-RUN echo >>mkconfig '<$ROOT/mkfiles/mkfile-$SYSTARG-$OBJTYPE'
-
 # build code
 RUN ./makemk.sh
 ENV PATH="$INFERNO/Linux/386/bin:${PATH}"
@@ -34,6 +30,27 @@
 RUN mk mkdirs
 RUN mk install
 
-# docker run -it mehlon/purgatorio
-CMD ["emu", "-c1",  "echo", "Hello from Purgatory!" ]
 
+FROM i386/busybox:glibc AS inferno
+ARG CONF
+
+RUN mkdir -p /usr/lib/i386-linux-gnu/
+COPY --from=build \
+	/usr/lib/i386-linux-gnu/libX11.so.6 \
+	/usr/lib/i386-linux-gnu/libxcb.so.1 \
+	/usr/lib/i386-linux-gnu/libXau.so.6 \
+	/usr/lib/i386-linux-gnu/libXdmcp.so.6 \
+	/usr/lib/i386-linux-gnu/libXext.so.6 \
+	/usr/lib/i386-linux-gnu/libbsd.so.0   /usr/lib/i386-linux-gnu/
+RUN mkdir -p /lib/i386-linux-gnu/
+COPY --from=build \
+	/lib/i386-linux-gnu/libgcc_s.so.1 \
+	/lib/i386-linux-gnu/libdl.so.2 \
+	/lib/i386-linux-gnu/librt.so.1	 /lib/i386-linux-gnu/
+
+#RUN apt-get -y install libx11-6 libxext6
+
+WORKDIR /usr/inferno
+COPY --from=build /usr/inferno/ .
+RUN cp ./Linux/386/bin/$CONF ./inferno
+CMD ["./inferno", "-c1",  "echo", "Hello from Purgatory!" ]