FROM lbjlaq/antigravity-manager:latest # update at 2026-3-12 v4.1.29 USER root # 1. Install socat (port forwarding), xvfb (virtual display), and dbus-x11 RUN apt-get update && apt-get install -y socat xvfb dbus-x11 && rm -rf /var/lib/apt/lists/* # 2. Specify working directory WORKDIR /app # 3. Set environment variables ENV PORT=7860 EXPOSE 7860 ENV DISPLAY=:99 # 4. Create configuration directory and set permissions RUN mkdir -p /root/.antigravity_tools && chmod -R 777 /root/.antigravity_tools # 5. Write the startup script directly RUN echo '#!/bin/bash\n\ echo "Starting Xvfb (Virtual Display)..."\n\ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n\ sleep 2\n\ \n\ echo "Starting Antigravity Tools..."\n\ # Adjust the path based on the actual image contents, usually ./antigravity-tools\n\ if [ -f "./antigravity-tools" ]; then\n\ ./antigravity-tools headless &\n\ fi\n\ \n\ echo "Waiting for Antigravity Tools to open port 8045..."\n\ while ! timeout 1 bash -c "echo > /dev/tcp/127.0.0.1/8045" 2>/dev/null; do\n\ sleep 1\n\ done\n\ \n\ echo "App is ready! Starting socat proxy 7860 -> 8045..."\n\ exec socat TCP-LISTEN:7860,fork,bind=0.0.0.0 TCP:127.0.0.1:8045\n\ ' > /start.sh && chmod +x /start.sh # 6. Run the script ENTRYPOINT [] CMD ["/bin/bash", "/start.sh"]