Optimize build process
parent
7911c7eefc
commit
cc45226e7d
|
@ -1,26 +1,27 @@
|
||||||
# Build container
|
# Build container
|
||||||
FROM debian:11-slim AS builder
|
FROM debian:11-slim AS builder
|
||||||
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install gcc libpcap-dev libvdeplug-dev libpcre3-dev libedit-dev libsdl2-dev libpng-dev libsdl2-ttf-dev build-essential && apt-get clean
|
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install --no-install-recommends build-essential ca-certificates curl gcc libpcap-dev libvdeplug-dev && apt-get clean
|
||||||
ADD simh-3.9-0.tgz /
|
ARG SIMH_VERSION=3.9-0
|
||||||
WORKDIR /simh-3.9-0
|
RUN curl -L https://github.com/simh/simh/archive/refs/tags/v${SIMH_VERSION}.tar.gz|tar -xzC /
|
||||||
RUN make pdp11
|
WORKDIR /simh-${SIMH_VERSION}
|
||||||
|
RUN make pdp11 && ln /simh-${SIMH_VERSION}/BIN/pdp11 /pdp11
|
||||||
|
|
||||||
# Final container
|
# Final container
|
||||||
FROM debian:11-slim
|
FROM debian:11-slim
|
||||||
ENV DISK_FILENAME=rq0.dsk
|
ENV DISK_FILENAME=rq0.dsk
|
||||||
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install curl ed gcc iproute2 iptables libpcap-dev libpcre3 net-tools telnet vdeplug
|
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install --no-install-recommends ca-certificates curl ed iproute2 iptables libpcap-dev net-tools telnet vdeplug
|
||||||
|
|
||||||
# Add Tini to handle reaping processes
|
# Add Tini to handle reaping processes
|
||||||
ENV TINI_VERSION 0.19.0
|
ARG TINI_VERSION=0.19.0
|
||||||
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini /tini
|
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini /tini
|
||||||
RUN chmod +x /tini
|
RUN chmod +x /tini
|
||||||
ENTRYPOINT ["/tini", "--"]
|
ENTRYPOINT ["/tini", "--"]
|
||||||
|
|
||||||
# Add CoreDNS to forward DNS based on /etc/resolv.conf
|
# Add CoreDNS to forward DNS based on /etc/resolv.conf
|
||||||
ENV COREDNS_VERSION 1.11.1
|
ARG COREDNS_VERSION=1.11.1
|
||||||
RUN curl -L https://github.com/coredns/coredns/releases/download/v${COREDNS_VERSION}/coredns_${COREDNS_VERSION}_linux_amd64.tgz|tar -xzC /usr/local/bin/
|
RUN curl -L https://github.com/coredns/coredns/releases/download/v${COREDNS_VERSION}/coredns_${COREDNS_VERSION}_linux_amd64.tgz|tar -xzC /usr/local/bin/
|
||||||
|
|
||||||
COPY --from=builder /simh-3.9-0/BIN/pdp11 /usr/local/bin/pdp11
|
COPY --from=builder /pdp11 /usr/local/bin/pdp11
|
||||||
|
|
||||||
# Uses pattern matching to optionally copy rq0.dsk.gz if it exists
|
# Uses pattern matching to optionally copy rq0.dsk.gz if it exists
|
||||||
COPY startup.sh Corefile boot.ini.template rq0.dsk.g[z] /
|
COPY startup.sh Corefile boot.ini.template rq0.dsk.g[z] /
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
usage () {
|
|
||||||
echo "usage: $0 tag"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -n "$1" ] && tag="$1" || usage
|
|
||||||
|
|
||||||
file="simh-3.9-0.tgz"
|
|
||||||
url="https://codeload.github.com/simh/simh/tar.gz/refs/tags/v3.9-0"
|
|
||||||
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
[ -f "$file" ] || wget "$url" -O "$file"
|
|
||||||
|
|
||||||
docker build -t "$tag" .
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
[ -e "/dev/net/tun" ] || { echo "/dev/net/tun not found. Is the container running in privileged mode?"; exit 1; }
|
||||||
|
|
||||||
[ -n "$DISK_FILENAME" ] || DISK_FILENAME="rq0.dsk"
|
[ -n "$DISK_FILENAME" ] || DISK_FILENAME="rq0.dsk"
|
||||||
|
|
||||||
echo -n "Checking for disk... "
|
echo -n "Checking for disk... "
|
||||||
|
|
Loading…
Reference in New Issue