Advertisement
Guest User

dddddddd

a guest
Apr 9th, 2025
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. # Use the latest stable Ubuntu LTS image
  2. FROM ubuntu:22.04
  3.  
  4. # Set frontend to noninteractive to avoid prompts during package installation
  5. ENV DEBIAN_FRONTEND=noninteractive
  6.  
  7. # Install dependencies: curl for downloading, wget (alternative), sudo for user privileges
  8. RUN apt-get update && \
  9. apt-get install -y --no-install-recommends \
  10. curl \
  11. wget \
  12. sudo \
  13. ca-certificates \
  14. # Clean up apt cache to reduce image size
  15. && rm -rf /var/lib/apt/lists/*
  16.  
  17. # Install the latest stable release of code-server using the official script
  18. # The script handles dependencies needed by code-server itself
  19. RUN curl -fsSL https://code-server.dev/install.sh | sh
  20.  
  21. # Install the Roo Code extension
  22. # Note: This runs as root initially, but code-server installs extensions per-user later if needed.
  23. # Running it here ensures it's available system-wide or for the default user setup.
  24. RUN code-server --install-extension RooVeterinaryInc.roo-cline
  25.  
  26. # Create a non-root user 'coder' with a home directory and bash shell
  27. RUN useradd -m -s /bin/bash coder && \
  28. # Add the user to the sudo group
  29. adduser coder sudo && \
  30. # Allow the user to run sudo commands without a password
  31. echo 'coder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
  32.  
  33. # Switch to the non-root user
  34. USER coder
  35.  
  36. # Set the working directory to the user's home directory
  37. WORKDIR /home/coder
  38.  
  39. # Expose the default code-server port
  40. EXPOSE 8080
  41.  
  42. # Default command to start code-server
  43. # Binds to 0.0.0.0 to be accessible outside the container
  44. # --auth none disables authentication (convenient for local dev, insecure for production)
  45. # For production, remove --auth none and set a password via environment variable or config file.
  46. CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "none"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement