Download Dockerfile from ar08/train: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/spaces/ar08/train/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ar08/train/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ar08/train/resolve/main/Dockerfile
1.44 kB
| # Use Kali Linux as base image | |
| FROM kalilinux/kali-rolling | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE 1 | |
| ENV PYTHONUNBUFFERED 1 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV TERM=xterm-256color | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy the local directory's contents into the container at /app | |
| COPY ./ /app/ | |
| # Update and install necessary packages | |
| RUN apt-get update && \ | |
| apt-get install -y \ | |
| python3 \ | |
| python3-pip \ | |
| curl \ | |
| wget \ | |
| gnupg2 \ | |
| lsb-release \ | |
| nano \ | |
| apktool \ | |
| sudo \ | |
| netcat-traditional \ | |
| virtualbox \ | |
| virtualbox-dkms \ | |
| linux-headers-amd64 \ | |
| git \ | |
| cmake \ | |
| fakeroot # Include fakeroot here | |
| # Install Python dependencies (assuming requirements.txt is in the same directory) | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # Create a new user | |
| RUN useradd -r -u 1000 -m -s /bin/bash appuser && \ | |
| chown -R appuser:appuser /app | |
| # Grant execute permissions to all files in the /app directory | |
| RUN chmod +x /app/* | |
| # Modify sudoers file to allow passwordless sudo | |
| RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/appuser && \ | |
| chmod 0440 /etc/sudoers.d/appuser | |
| # Switch to the new user | |
| USER appuser | |
| # Run pyxtermjs when the container starts | |
| CMD ["python3", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"] | |