-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (58 loc) · 1.84 KB
/
Copy pathDockerfile
File metadata and controls
71 lines (58 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM andybalaam/apache
MAINTAINER Andy Balaam <andybalaam@artificialworlds.net>
# Enable non-free for the spectrum-roms package :-(
RUN \
perl -p -i -e 's/main/main non-free/' /etc/apt/sources.list
# Install the bas2tap utility
RUN \
apt-get update && \
apt-get install -y \
git \
gcc \
make \
&& \
git clone https://github.com/andybalaam/bas2tap.git && \
cd bas2tap && \
make
# The packages that are used at runtime
RUN \
apt-get install -y \
fuse-emulator-sdl \
spectrum-roms \
xvfb
# Patch xvfb-run so it works inside a CGI script -
# instead of "wait || :" (which I don't understand)
# we just "sleep 0.2" before checking whether the
# Xvfb process started OK.
COPY xvfb-run.patch /
RUN \
apt-get install -y patch && \
patch /usr/bin/xvfb-run < /xvfb-run.patch && \
rm /xvfb-run.patch
# Useful if you make run-interactive
RUN apt-get install -y vim
# Clean packages that aren't needed at runtime
RUN \
apt-get remove -y \
git \
gcc \
make \
patch \
&& \
apt-get autoremove -y && \
apt-get clean
# Apache config
COPY spectrum-basic.conf /etc/apache2/conf-available/
RUN /bin/ln -sf /etc/apache2/conf-available/spectrum-basic.conf /etc/apache2/conf-enabled/
RUN /bin/ln -sf /etc/apache2/mods-available/cgi.load /etc/apache2/mods-enabled/
RUN /bin/ln -sf /etc/apache2/mods-available/actions.conf /etc/apache2/mods-enabled/
RUN /bin/ln -sf /etc/apache2/mods-available/actions.load /etc/apache2/mods-enabled/
# The magic that makes Spectrum BASIC run as CGI
COPY spectrum-basic.cgi /usr/lib/cgi-bin/
# Example basic programs
COPY hello.basic /var/www/html/
COPY hello-name.basic /var/www/html/
# Useful if you make run-interactive
COPY startapache /
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]