# VSCode Kubernetes Optimized Dockerfile FROM codercom/enterprise-base:ubuntu # Avoid prompts from apt ENV DEBIAN_FRONTEND=noninteractive # Set environment variables ENV WORKSPACE_DIR=/home/coder/workspace COPY RJ_ROOT_CA.pem /usr/local/share/ca-certificates/RJ_ROOT_CA.crt RUN sudo update-ca-certificates COPY openssl.cnf /etc/ssl/openssl.cnf ENV OPENSSL_CONF=/etc/ssl/openssl.cnf # Install essential packages RUN sudo apt-get update && sudo apt-get install -y \ curl \ unzip \ wget \ git \ sudo \ build-essential \ python3 \ python3-pip \ nodejs \ npm \ ca-certificates \ openjdk-17-jdk \ maven \ gradle \ && sudo rm -rf /var/lib/apt/lists/* # Adding AWS CLI RUN sudo curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "./awscliv2.zip" RUN sudo unzip awscliv2.zip RUN sudo ./aws/install # Create workspace directory RUN mkdir -p ${WORKSPACE_DIR} # Download and install code-server RUN curl -fsSL https://code-server.dev/install.sh | sh # Pre-create basic code-server directories (the startup script will handle the rest) RUN mkdir -p /home/coder/.local/share/code-server RUN mkdir -p /home/coder/.config/code-server # Install useful VSCode extensions # RUN code-server --install-extension ms-vscode.vscode-json \ # --install-extension ms-python.python \ # --install-extension ms-vscode.vscode-typescript-next \ # --install-extension esbenp.prettier-vscode \ # --install-extension bradlc.vscode-tailwindcss \ # --install-extension ms-vscode.vscode-markdown \ # --install-extension ms-vscode.vscode-node-debug2 \ # --install-extension formulahendry.auto-rename-tag \ # --install-extension christian-kohler.path-intellisense \ # --install-extension shardulm94.trailing-spaces \ # --install-extension ms-vscode.bracket-pair-colorizer-2 \ # --install-extension oderwat.indent-rainbow \ # --install-extension gitpod.gitpod-theme # Create enhanced Git setup script for TFS/Azure DevOps COPY scripts/setup-git-auth /usr/local/bin/setup-git-auth RUN sudo chmod +x /usr/local/bin/setup-git-auth # Create startup script for Kubernetes COPY scripts/start-workspace /usr/local/bin/start-workspace RUN sudo chmod +x /usr/local/bin/start-workspace # Set proper permissions RUN chown -R coder:coder /home/coder RUN sudo chmod -R 755 /usr/local/bin # Expose ports EXPOSE 8080 8081 # Set working directory WORKDIR /home/coder/workspace # Use non-root user USER coder # Start the workspace CMD ["/usr/local/bin/start-workspace"]