| 1 |
FROM ubuntu:22.04 |
| 2 |
|
| 3 |
# No interactive frontend during docker build |
| 4 |
ENV DEBIAN_FRONTEND=noninteractive \ |
| 5 |
DEBCONF_NONINTERACTIVE_SEEN=true |
| 6 |
|
| 7 |
# General requirements not in the base image |
| 8 |
RUN apt-get -qqy update \ |
| 9 |
&& apt-get -qqy install \ |
| 10 |
bridge-utils \ |
| 11 |
bzip2 \ |
| 12 |
ca-certificates \ |
| 13 |
curl \ |
| 14 |
dbus-x11 \ |
| 15 |
earlyoom \ |
| 16 |
fonts-noto \ |
| 17 |
fluxbox \ |
| 18 |
gdebi \ |
| 19 |
git \ |
| 20 |
glib-networking-services \ |
| 21 |
gstreamer1.0-plugins-bad \ |
| 22 |
gstreamer1.0-gl \ |
| 23 |
libosmesa6-dev \ |
| 24 |
libproxy1-plugin-webkit \ |
| 25 |
libvirt-daemon-system \ |
| 26 |
libvirt-clients \ |
| 27 |
libunwind8 \ |
| 28 |
libxcb-shape0-dev \ |
| 29 |
locales \ |
| 30 |
openjdk-17-jre-headless \ |
| 31 |
pulseaudio \ |
| 32 |
python3 \ |
| 33 |
python3-dev \ |
| 34 |
python3-pip \ |
| 35 |
python3-venv \ |
| 36 |
software-properties-common \ |
| 37 |
qemu-kvm \ |
| 38 |
tzdata \ |
| 39 |
sudo \ |
| 40 |
unzip \ |
| 41 |
wget \ |
| 42 |
xvfb |
| 43 |
|
| 44 |
# Ensure all Python versions are available |
| 45 |
RUN apt-add-repository -y ppa:deadsnakes/ppa |
| 46 |
|
| 47 |
# Ensure a `python` binary exists |
| 48 |
RUN apt-get -qqy update \ |
| 49 |
&& apt-get install -qqy python-is-python3 |
| 50 |
|
| 51 |
# Installing just the deps of firefox and chrome is moderately tricky, so |
| 52 |
# just install the default versions of them, and some extra deps we happen |
| 53 |
# to know that chrome requires |
| 54 |
|
| 55 |
RUN apt-get -qqy install \ |
| 56 |
firefox \ |
| 57 |
libnss3-tools \ |
| 58 |
fonts-liberation \ |
| 59 |
indicator-application \ |
| 60 |
libappindicator1 \ |
| 61 |
libappindicator3-1 \ |
| 62 |
libdbusmenu-gtk3-4 \ |
| 63 |
libindicator3-7 \ |
| 64 |
libindicator7 |
| 65 |
|
| 66 |
RUN apt-get -y autoremove |
| 67 |
|
| 68 |
RUN pip install --upgrade pip |
| 69 |
|
| 70 |
ENV TZ "UTC" |
| 71 |
RUN echo "${TZ}" > /etc/timezone \ |
| 72 |
&& dpkg-reconfigure --frontend noninteractive tzdata |
| 73 |
|
| 74 |
# Set the locale |
| 75 |
RUN locale-gen en_US.UTF-8 |
| 76 |
ENV LANG en_US.UTF-8 |
| 77 |
ENV LANGUAGE en_US:en |
| 78 |
ENV LC_ALL en_US.UTF-8 |
| 79 |
|
| 80 |
# Setup on-demand pulseaudio with a "Dummy Output" audio sink. |
| 81 |
# This simply creates a file containing autospawn=yes at |
| 82 |
# /run/pulseaudio-enable-autospawn, linked from /etc/pulse/client.conf.d/ |
| 83 |
RUN /etc/init.d/pulseaudio-enable-autospawn start |
| 84 |
|
| 85 |
RUN useradd test \ |
| 86 |
--shell /bin/bash \ |
| 87 |
--create-home \ |
| 88 |
&& usermod -a -G sudo test \ |
| 89 |
&& usermod -a -G kvm test \ |
| 90 |
&& usermod -a -G libvirt test \ |
| 91 |
&& usermod -a -G libvirt-qemu test \ |
| 92 |
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \ |
| 93 |
&& echo 'test:secret' | chpasswd |
| 94 |
|
| 95 |
ENV SCREEN_WIDTH 1280 |
| 96 |
ENV SCREEN_HEIGHT 1024 |
| 97 |
ENV SCREEN_DEPTH 24 |
| 98 |
ENV DISPLAY :99.0 |
| 99 |
|
| 100 |
USER test |
| 101 |
|
| 102 |
WORKDIR /home/test |
| 103 |
|
| 104 |
# Remove information on how to use sudo on login |
| 105 |
RUN sudo echo "" |
| 106 |
|
| 107 |
RUN mkdir -p /home/test/artifacts |
| 108 |
RUN mkdir -p /home/test/bin |
| 109 |
|
| 110 |
ENV PATH="/home/test/bin:/home/test/.local/bin:${PATH}" |
| 111 |
|
| 112 |
WORKDIR /home/test/ |
| 113 |
|
| 114 |
COPY .bashrc /home/test/.bashrc |
| 115 |
|
| 116 |
COPY start.sh /home/test/start.sh |
| 117 |
COPY retry.py /home/test/bin/retry |