docker-qemu-reactos/Dockerfile

94 lines
3.0 KiB
Docker
Raw Normal View History

2019-11-02 10:34:53 +00:00
##################################################
2020-06-10 20:48:26 +00:00
## "build" stage
2019-11-02 10:34:53 +00:00
##################################################
2020-06-10 20:48:26 +00:00
FROM docker.io/ubuntu:20.04 AS build
2019-02-20 22:10:38 +00:00
# Install system packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
&& rm -rf /var/lib/apt/lists/*
2020-06-10 20:48:26 +00:00
# Download noVNC
2020-07-14 18:32:22 +00:00
ARG NOVNC_VERSION=v1.2.0
2019-09-15 18:55:14 +00:00
ARG NOVNC_TARBALL_URL=https://github.com/novnc/noVNC/archive/${NOVNC_VERSION}.tar.gz
2020-07-14 18:32:22 +00:00
ARG NOVNC_TARBALL_CHECKSUM=36c476b26df4684f1002e15c3d7e034c9e6ee4521e5fa8aac37309f954a07a01
2020-06-10 20:48:26 +00:00
RUN curl -Lo /tmp/novnc.tgz "${NOVNC_TARBALL_URL:?}"
RUN printf '%s' "${NOVNC_TARBALL_CHECKSUM:?} /tmp/novnc.tgz" | sha256sum -c
RUN mkdir /tmp/novnc/ && tar -xzf /tmp/novnc.tgz --strip-components=1 -C /tmp/novnc/
2019-09-15 18:55:14 +00:00
2020-06-10 20:48:26 +00:00
# Download Websockify
2019-09-15 18:55:14 +00:00
ARG WEBSOCKIFY_VERSION=v0.9.0
ARG WEBSOCKIFY_TARBALL_URL=https://github.com/novnc/websockify/archive/${WEBSOCKIFY_VERSION}.tar.gz
2019-09-21 09:03:30 +00:00
ARG WEBSOCKIFY_TARBALL_CHECKSUM=6ebfec791dd78be6584fb5fe3bc27f02af54501beddf8457368699f571de13ae
2020-06-10 20:48:26 +00:00
RUN curl -Lo /tmp/websockify.tgz "${WEBSOCKIFY_TARBALL_URL:?}"
RUN printf '%s' "${WEBSOCKIFY_TARBALL_CHECKSUM:?} /tmp/websockify.tgz" | sha256sum -c
RUN mkdir /tmp/websockify/ && tar -xzf /tmp/websockify.tgz --strip-components=1 -C /tmp/websockify/
2019-02-20 22:10:38 +00:00
# Download ReactOS ISO
2021-05-25 19:41:46 +00:00
ARG REACTOS_ISO_URL=https://downloads.sourceforge.net/project/reactos/ReactOS/0.4.14/ReactOS-0.4.14-RC-67-gef623b1-iso.zip
ARG REACTOS_ISO_CHECKSUM=07a68ab9d64c7f7e26e5a15a57c260ac8c453eb1335c490f1726efd3e7122a26
2020-06-10 20:48:26 +00:00
RUN curl -Lo /tmp/reactos.zip "${REACTOS_ISO_URL:?}"
RUN printf '%s' "${REACTOS_ISO_CHECKSUM:?} /tmp/reactos.zip" | sha256sum -c
RUN unzip -p /tmp/reactos.zip 'ReactOS-*.iso' > /tmp/reactos.iso
##################################################
## "qemu-reactos" stage
##################################################
FROM docker.io/ubuntu:20.04 AS qemu-reactos
# Install system packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
net-tools \
procps \
python3 \
qemu-kvm \
qemu-system-x86 \
qemu-utils \
runit \
&& rm -rf /var/lib/apt/lists/*
# Environment
ENV QEMU_CPU=2
ENV QEMU_RAM=1024M
ENV QEMU_DISK_SIZE=16G
ENV QEMU_DISK_FORMAT=qcow2
ENV QEMU_KEYBOARD=en-us
ENV QEMU_NET_DEVICE=e1000
ENV QEMU_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900
ENV QEMU_BOOT_ORDER=cd
ENV QEMU_BOOT_MENU=off
ENV QEMU_KVM=false
# Create some directories for QEMU
RUN mkdir -p /var/lib/qemu/iso/ /var/lib/qemu/images/
# Copy noVNC
COPY --from=build --chown=root:root /tmp/novnc/ /opt/novnc/
# Copy Websockify
COPY --from=build --chown=root:root /tmp/websockify/ /opt/novnc/utils/websockify/
# Copy ReactOS ISO
COPY --from=build --chown=root:root /tmp/reactos.iso /var/lib/qemu/iso/reactos.iso
2019-02-20 22:10:38 +00:00
# Copy services
2020-05-22 15:00:57 +00:00
COPY --chown=root:root ./scripts/service/ /etc/service/
2019-02-20 22:10:38 +00:00
# Copy scripts
2020-05-22 15:00:57 +00:00
COPY --chown=root:root ./scripts/bin/ /usr/local/bin/
2019-02-20 22:10:38 +00:00
2020-06-10 20:48:26 +00:00
# VNC
2019-03-07 20:50:38 +00:00
EXPOSE 5900/tcp
2020-06-10 20:48:26 +00:00
# noVNC
2019-02-20 22:10:38 +00:00
EXPOSE 6080/tcp
CMD ["/usr/local/bin/container-foreground-cmd"]