code: purgatorio

Download patch

ref: 53aac62a54ebbcc1781c0000d3e2384ed038c7bb
parent: b7af62b250e5dff30320a181ca9d53ab5a7c276d
author: mehlon <mehlon@users.noreply.github.com>
date: Sat Sep 21 16:05:45 EDT 2019

add Dockerfile, Docker instructions

--- /dev/null
+++ b/.dockerignore
@@ -1,0 +1,71 @@
+.git
+.hg*
+
+*.dis
+*.sbl
+
+# the following are copied from .hgignore
+*.[8qkv5967o]
+*.obj
+[8qkv965o].out
+[8qkv965o].emu
+obj.out
+obj.map
+vc*.pdb
+y.output
+y.tab.[ch]
+y.debug
+*.a
+emu/*/*.root.[ch]
+emu/*/errstr.h
+emu/*/srv.h
+emu/*/srvm.h
+[A-Z]*/*/bin/?[acl]
+[A-Z]*/*/bin/5coff
+[A-Z]*/*/bin/5cv
+[A-Z]*/*/bin/acid
+[A-Z]*/*/bin/asm
+[A-Z]*/*/bin/data2s
+[A-Z]*/*/bin/emu
+[A-Z]*/*/bin/limbo
+Nt/*/bin/?[acl].exe
+Nt/*/bin/5coff.exe
+Nt/*/bin/5cv.exe
+Nt/*/bin/acid.exe
+Nt/*/bin/asm.exe
+Nt/*/bin/data2s.exe
+Nt/*/bin/emu.exe
+Nt/*/bin/limbo.exe
+Nt/*/bin/ftl.exe
+Nt/*/bin/iar.exe
+Nt/*/bin/idea.exe
+Nt/*/bin/inm.exe
+Nt/*/bin/kprof.exe
+Nt/*/bin/ksize.exe
+Nt/*/bin/kstrip.exe
+Nt/*/bin/md5sum.exe
+Nt/*/bin/mkppcimage.exe
+Nt/*/bin/ms2.exe
+Nt/*/bin/ndate.exe
+Nt/*/bin/ntsrv.exe
+Nt/*/bin/sqz.exe
+Nt/*/bin/srclist.exe
+Nt/*/bin/styxtest.exe
+emu/Nt/*.map
+emu/Nt/*.exe
+keydb/keys
+keydb/countersigned
+keydb/signed
+keydb/signerkey
+tmp/*
+
+# Only Linux 386 files are needed for Docker
+arm/*
+power/*
+spim/*
+MacOSX/*
+Nt/*
+Dragonfly/*
+FreeBSD/*
+NetBSD/*
+OpenBSD/*
--- /dev/null
+++ b/Dockerfile
@@ -1,0 +1,39 @@
+FROM i386/ubuntu:devel
+
+RUN apt-get -y update
+RUN apt-get install -y libx11-dev \
+	libxext-dev \
+	libc6-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 '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}"
+RUN mk nuke
+RUN mk mkdirs
+RUN mk install
+
+# docker run -it mehlon/purgatorio
+CMD ["emu", "-c1",  "echo", "Hello from Purgatory!" ]
+
--- a/INSTALL
+++ b/INSTALL
@@ -91,9 +91,19 @@
 
 1    Edit mkconfig
 
-2    Add $INFERNO/Nt/386/bin to Path 
+2    Add $INFERNO/Nt/386/bin to Path
 
 3    Start Developer Command Prompt
 
 4    `mk install`
 
+Inferno can also be built with the provided Dockerfile:
+1    `docker build -t purgatorio .`
+
+2    `docker run -it purgatorio emu`
+
+This will build Inferno on a small Ubuntu base. Note that Docker sandboxes network connections by default. If you want to forward ports from the Inferno container to your host machine, you can use `docker run -p 8080:80` to forward the port 8080 (host) to the port 80 (Inferno). If you want to run graphical programs and have an Xorg server running, you have to disable network sandboxing and pass the $DISPLAY variable to Docker like this:
+
+`docker run --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" purgatorio emu wm/wm`
+
+This works on Linux. On Windows and macOS you would need some kind of custom Xserver setup to make this work.