Update Dockerfile
Browse files- Dockerfile +7 -38
Dockerfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# Use Python 3.9 as base image
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
# Set environment variables
|
|
@@ -7,41 +6,20 @@ ENV PYTHONUNBUFFERED 1
|
|
| 7 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 8 |
ENV TERM=xterm-256color
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
WORKDIR /app
|
| 12 |
-
|
| 13 |
-
# Copy the local directory's contents into the container at /app
|
| 14 |
-
COPY ./ /app/
|
| 15 |
-
RUN apt-get clean
|
| 16 |
-
|
| 17 |
RUN apt-get update && \
|
| 18 |
-
|
| 19 |
-
apt-get install curl wget gnupg2 lsb-release nano -y
|
| 20 |
-
|
| 21 |
|
|
|
|
| 22 |
RUN curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/vbox.gpg
|
| 23 |
-
|
| 24 |
RUN echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" > /etc/apt/sources.list.d/virtualbox.list
|
| 25 |
-
|
| 26 |
RUN apt-get update && \
|
| 27 |
-
apt-get install -y
|
| 28 |
-
linux-headers-amd64 \
|
| 29 |
-
dkms
|
| 30 |
-
|
| 31 |
-
RUN apt-get install virtualbox -y
|
| 32 |
-
|
| 33 |
|
| 34 |
-
# Install dependencies
|
| 35 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 36 |
-
#RUN sudo apt-get install -y psmisc libqt5core5a libqt5dbus5 libqt5gui5 libqt5gui5-gles libqt5help5 libqt5opengl5 libqt5printsupport5 libqt5widgets5 libqt5x11extras5 libqt5xml5
|
| 37 |
-
# Download and install VirtualBox
|
| 38 |
-
RUN wget -O virtualbox.deb https://download.virtualbox.org/virtualbox/7.0.18/virtualbox-7.0_7.0.18-162988~Debian~bullseye_amd64.deb && \
|
| 39 |
-
dpkg -i virtualbox.deb && \
|
| 40 |
-
apt-get install -f -y && \
|
| 41 |
-
rm virtualbox.deb
|
| 42 |
|
| 43 |
-
|
| 44 |
-
# Create a new user without creating a group
|
| 45 |
RUN useradd -r -u 1000 -m -s /bin/bash appuser && \
|
| 46 |
chown -R appuser:appuser /app
|
| 47 |
|
|
@@ -51,14 +29,5 @@ RUN chmod +x /app/*
|
|
| 51 |
# Switch to the new user
|
| 52 |
USER appuser
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
# Download the Ubuntu ISO
|
| 58 |
-
#RUN wget -O /app/ubuntu-20.04-live-server-amd64.iso https://old-releases.ubuntu.com/releases/20.04.2/ubuntu-20.04.2-live-server-amd64.iso
|
| 59 |
-
|
| 60 |
-
# Run the custom script to install the VM
|
| 61 |
-
#RUN ./manage.sh install-vm
|
| 62 |
-
|
| 63 |
# Run pyxtermjs when the container starts
|
| 64 |
-
CMD ["python", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
# Set environment variables
|
|
|
|
| 6 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
ENV TERM=xterm-256color
|
| 8 |
|
| 9 |
+
# Install required packages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
RUN apt-get update && \
|
| 11 |
+
apt-get install -y curl wget gnupg2 lsb-release nano
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Add VirtualBox repository and install VirtualBox
|
| 14 |
RUN curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/vbox.gpg
|
|
|
|
| 15 |
RUN echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" > /etc/apt/sources.list.d/virtualbox.list
|
|
|
|
| 16 |
RUN apt-get update && \
|
| 17 |
+
apt-get install -y linux-headers-amd64 dkms virtualbox
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
# Create a new user
|
|
|
|
| 23 |
RUN useradd -r -u 1000 -m -s /bin/bash appuser && \
|
| 24 |
chown -R appuser:appuser /app
|
| 25 |
|
|
|
|
| 29 |
# Switch to the new user
|
| 30 |
USER appuser
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# Run pyxtermjs when the container starts
|
| 33 |
+
CMD ["python", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"]
|