Some checks failed
CI/CD Pipeline - Build, Test, and Deploy / 🔒 Security Scan (push) Failing after 0s
CI/CD Pipeline - Build, Test, and Deploy / 🧪 Test & Lint (push) Failing after 18m55s
CI/CD Pipeline - Build, Test, and Deploy / 🚀 Deploy to Development (push) Has been cancelled
CI/CD Pipeline - Build, Test, and Deploy / 🏭 Deploy to Production (push) Has been cancelled
CI/CD Pipeline - Build, Test, and Deploy / 🧹 Cleanup (push) Has been cancelled
CI/CD Pipeline - Build, Test, and Deploy / 🏗️ Build & Push Image (push) Has been cancelled
CI/CD Pipeline - Build, Test, and Deploy / 🛡️ Image Security Scan (push) Has been cancelled
80 lines
2.5 KiB
Docker
80 lines
2.5 KiB
Docker
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"] |