re-organizing, again...

This commit is contained in:
2020-08-02 11:47:07 -04:00
parent ead87a4451
commit 059d4ac4fc
8 changed files with 12 additions and 25 deletions

View File

@ -1,4 +0,0 @@
# don't accidentally commit OS images (again...)
*.img
*.raw
*.qcow2

View File

@ -1,61 +0,0 @@
FROM docker.io/ubuntu:20.04
LABEL maintainer="Jake Jarvis <jake@jarv.is>"
LABEL repository="https://github.com/jakejarvis/y2k"
LABEL homepage="https://y2k.jarv.is/"
ARG DEBIAN_FRONTEND=noninteractive
# corrects the time inside the Windows VM, if tzdata is installed below
ENV TZ=America/New_York
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y --no-install-recommends install \
ca-certificates \
tzdata \
qemu-system-x86 \
qemu-utils \
ruby \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# make sure everything's okay so far
RUN qemu-system-i386 --version \
&& ruby --version
ENV TINI_VERSION 0.19.0
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini /usr/local/bin/tini
RUN chmod +x /usr/local/bin/tini
# ----
# TODO: make *each container* a websockets server so we can load balance, etc.
# ENV WEBSOCKETD_VERSION 0.3.1
# RUN wget https://github.com/joewalnes/websocketd/releases/download/v${WEBSOCKETD_VERSION}/websocketd-${WEBSOCKETD_VERSION}-linux_amd64.zip \
# && unzip websocketd-${WEBSOCKETD_VERSION}-linux_amd64.zip \
# && chmod +x websocketd \
# && mv websocketd /usr/local/bin/
# RUN websocketd --version
# EXPOSE 80
# ----
# do everything as an unprivileged user :)
RUN useradd -m vm
# copy boot script and Windows HDD (must be at ./hdd/hdd.img)
COPY bin/boot.rb /usr/local/bin/boot-vm
COPY --chown=vm hdd/hdd.img /home/vm/hdd.img
# make double sure the boot script is executable & the hard drive was copied
RUN chmod +x /usr/local/bin/boot-vm \
&& ls -lah /home/vm
# bye bye root <3
USER vm
WORKDIR /home/vm
ENTRYPOINT ["tini", "--"]
CMD ["boot-vm"]

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -euxo pipefail
# what a mess. https://stackoverflow.com/a/53183593
YOU_ARE_HERE="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# container will be useless unless we bundle the actual OS
test -f "$YOU_ARE_HERE"/hdd/hdd.img
# this image is private on Google Cloud Registry, make sure we're logged in
gcloud auth configure-docker
docker build -t gcr.io/jakejarvis/y2k:latest --no-cache "$YOU_ARE_HERE"
docker push gcr.io/jakejarvis/y2k:latest