FROM ubuntu:22.04 # Avoid prompts from apt ENV DEBIAN_FRONTEND=noninteractive # Update and install basic dependencies RUN apt-get update && apt-get install -y \ curl \ wget \ git \ build-essential \ ca-certificates \ gnupg \ lsb-release \ sudo \ jq \ zip \ unzip \ && rm -rf /var/lib/apt/lists/* # Install Docker CLI RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ apt-get update && \ apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin && \ rm -rf /var/lib/apt/lists/* # Install Node.js 18 RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ apt-get install -y nodejs && \ rm -rf /var/lib/apt/lists/* # Install Python (often needed for various tools) RUN apt-get update && apt-get install -y \ python3 \ python3-pip \ python3-venv \ && rm -rf /var/lib/apt/lists/* # Install other useful CI/CD tools RUN apt-get update && apt-get install -y \ maven \ gradle \ ansible \ terraform \ kubectl \ helm \ && rm -rf /var/lib/apt/lists/* || true # Install GitHub CLI (gh) RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \ apt-get update && \ apt-get install -y gh && \ rm -rf /var/lib/apt/lists/* # Create a non-root user for running actions (optional but recommended) RUN useradd -m -s /bin/bash runner && \ echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ # Create docker group manually since we only installed docker-cli groupadd -f docker && \ usermod -aG docker runner # Set up Docker buildx RUN docker buildx create --name multibuilder --use || true # Verify installations RUN node --version && \ npm --version && \ docker --version && \ python3 --version && \ git --version # Set the working directory WORKDIR /workspace # Switch to non-root user (optional) # USER runner CMD ["/bin/bash"]