| FROM quay.io/centos/centos:stream9 | |
| # 1. Install EPEL, EPEL-Next (crucial for Stream 9), and enable CRB | |
| RUN dnf install -y epel-release epel-next-release dnf-plugins-core && \ | |
| dnf config-manager --set-enabled crb && \ | |
| dnf upgrade -y | |
| # 2. Install XRDP, VNC, Utilities, and explicitly install XFCE core packages | |
| # By listing the packages directly, we bypass the broken 'groupinstall' command | |
| RUN dnf install -y --nogpgcheck \ | |
| xrdp \ | |
| tigervnc-server \ | |
| sudo \ | |
| wget \ | |
| curl \ | |
| python3 \ | |
| xfce4-session \ | |
| xfce4-panel \ | |
| xfwm4 \ | |
| xfdesktop \ | |
| xfce4-settings \ | |
| xfce4-terminal && \ | |
| dnf clean all | |
| # 3. Install Tailscale | |
| RUN curl -fsSL https://tailscale.com/install.sh | sh | |
| # Setup the RDP user | |
| ENV USERNAME=hfuser | |
| # 4. Create user, grant sudo privileges, and configure XFCE to start on RDP login | |
| RUN useradd -m -s /bin/bash $USERNAME && \ | |
| echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ | |
| echo "startxfce4" > /home/$USERNAME/.Xclients && \ | |
| chmod +x /home/$USERNAME/.Xclients && \ | |
| chown $USERNAME:$USERNAME /home/$USERNAME/.Xclients | |
| # 5. Copy the initialization script | |
| COPY entrypoint.sh /entrypoint.sh | |
| RUN chmod +x /entrypoint.sh | |
| # Hugging Face requires a service to listen on port 7860 to mark the space as "Running" | |
| EXPOSE 7860 | |
| ENTRYPOINT ["/entrypoint.sh"] |