ARG UBUNTU_VERSION=24.04 FROM ubuntu:${UBUNTU_VERSION} LABEL maintainer="thommyho" LABEL description="An Ubuntu image with essential tools for git development and CI/CD pipelines." # Re-declare ARG to make it available inside the build stages (optional, but good practice) ARG UBUNTU_VERSION ENV NVM_DIR=/usr/local/nvm \ NODE_VERSION=24.11.1 \ NODE_PATH=/usr/local/nvm/v24.11.1/lib/node_modules \ PATH=/usr/local/nvm/versions/node/v24.11.1/bin:$PATH \ # This variable fixes the issue: it allows system-wide pip installs on Ubuntu 24.04+ # and is safely ignored by older Ubuntu versions (22.04, 20.04). PIP_BREAK_SYSTEM_PACKAGES=1 RUN apt-get update && apt-get install -y --no-install-recommends \ git \ curl \ wget \ build-essential \ ca-certificates \ python3 \ python3-pip \ && rm -rf /var/lib/apt/lists/* # Consolidated conan installation into one step. # The PIP_BREAK_SYSTEM_PACKAGES environment variable handles the version logic automatically. RUN pip install conan RUN mkdir -p $NVM_DIR && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \ . $NVM_DIR/nvm.sh && \ nvm install $NODE_VERSION && \ nvm use $NODE_VERSION && \ nvm alias default $NODE_VERSION RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -b /usr/local/bin