Update Dockerfile
Browse files- Dockerfile +18 -33
Dockerfile
CHANGED
|
@@ -12,34 +12,28 @@ 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 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 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 && \
|
|
@@ -51,14 +45,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"]
|
|
|
|
| 12 |
|
| 13 |
# Copy the local directory's contents into the container at /app
|
| 14 |
COPY ./ /app/
|
|
|
|
| 15 |
|
| 16 |
+
# Install necessary packages
|
| 17 |
RUN apt-get update && \
|
| 18 |
+
apt-get install -y --no-install-recommends \
|
| 19 |
+
curl \
|
| 20 |
+
wget \
|
| 21 |
+
gnupg2 \
|
| 22 |
+
lsb-release \
|
| 23 |
+
nano \
|
| 24 |
+
linux-headers-amd64 \
|
| 25 |
+
dkms
|
| 26 |
+
|
| 27 |
+
# Add VirtualBox repository and key
|
| 28 |
+
RUN curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/vbox.gpg && \
|
| 29 |
+
echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" > /etc/apt/sources.list.d/virtualbox.list
|
| 30 |
+
|
| 31 |
+
# Update package index and install VirtualBox
|
| 32 |
RUN apt-get update && \
|
| 33 |
+
apt-get install -y virtualbox
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
# Install Python dependencies
|
| 36 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
# Create a new user without creating a group
|
| 39 |
RUN useradd -r -u 1000 -m -s /bin/bash appuser && \
|
|
|
|
| 45 |
# Switch to the new user
|
| 46 |
USER appuser
|
| 47 |
|
| 48 |
+
# CMD instruction to start pyxtermjs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
CMD ["python", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"]
|