Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Kilo Code CLI Docker Image
  2. FROM node:20.19.2-bookworm-slim
  3. # Build arguments for metadata (all optional with defaults)
  4. ARG BUILD_DATE=""
  5. ARG VCS_REF=""
  6. ARG VERSION="latest"
  7. # OCI Image labels
  8. LABEL org.opencontainers.image.created="${BUILD_DATE}"
  9. LABEL org.opencontainers.image.revision="${VCS_REF}"
  10. LABEL org.opencontainers.image.version="${VERSION}"
  11. LABEL org.opencontainers.image.title="Kilo Code CLI"
  12. LABEL org.opencontainers.image.description="Docker image for Kilo Code CLI with Chromium support"
  13. LABEL org.opencontainers.image.vendor="Kilo Code"
  14. LABEL org.opencontainers.image.url="https://kilocode.ai/docs/cli"
  15. LABEL org.opencontainers.image.documentation="https://kilocode.ai/docs/cli"
  16. LABEL org.opencontainers.image.source="https://github.com/Kilo-Org/kilocode"
  17. LABEL org.opencontainers.image.licenses="Apache-2.0"
  18. # Install system dependencies and clean up in one layer
  19. RUN apt-get update && apt-get install -y \
  20. python3 \
  21. make \
  22. g++ \
  23. # Chromium and dependencies for puppeteer
  24. chromium \
  25. chromium-sandbox \
  26. fonts-liberation \
  27. fonts-noto-color-emoji \
  28. libnss3 \
  29. libnspr4 \
  30. libatk1.0-0 \
  31. libatk-bridge2.0-0 \
  32. libcups2 \
  33. libdrm2 \
  34. libxkbcommon0 \
  35. libxcomposite1 \
  36. libxdamage1 \
  37. libxfixes3 \
  38. libxrandr2 \
  39. libgbm1 \
  40. libasound2 \
  41. git \
  42. ca-certificates \
  43. && apt-get clean \
  44. && rm -rf /var/lib/apt/lists/*
  45. RUN npm install -g @kilocode/cli@latest
  46. # Set environment variables for Chromium
  47. ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
  48. PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium \
  49. CHROME_PATH=/usr/bin/chromium \
  50. CHROME_BIN=/usr/bin/chromium
  51. # Set home directory
  52. ENV HOME=/home/kilocode
  53. # Create non-root user and set up directories in one layer
  54. RUN groupadd -r kilocode && useradd -r -g kilocode -G audio,video kilocode \
  55. && mkdir -p /home/kilocode/.kilocode /workspace \
  56. && chown -R kilocode:kilocode /home/kilocode /workspace
  57. # Set working directory
  58. WORKDIR /workspace
  59. # Switch to non-root user
  60. USER kilocode
  61. # Use ENTRYPOINT so arguments are properly passed to the CLI
  62. ENTRYPOINT ["/usr/local/bin/kilocode"]
  63. # Default to interactive mode if no args provided
  64. CMD []