Compare commits

9 Commits

2 changed files with 106 additions and 1 deletions

39
Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
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

View File

@@ -1 +1,67 @@
# Docker Runner Gitea # Docker Runner Gitea
An Ubuntu-based Docker image with essential tools for Gitea CI/CD pipelines and development.
## Features
- **Base OS:** Ubuntu 24.04 (Noble)
- **Node.js:** v24.11.1 (managed via NVM)
- **Build Tools:** Essential development utilities including git, curl, wget, build-essential
- **Package Managers:** pip (Python 3), conan (C/C++ package manager)
- **Additional Tools:** Python 3, ca-certificates
## Prerequisites
- Docker installed on your system
- At least 2GB of free disk space
- Internet connection (for downloading base image and dependencies)
## Installation
### Building the Image
Clone or download this repository, then build the Docker image:
```sh
docker build -t package-cloud.dns.army/ros2/docker-runner-gitea:noble-node-24 .
```
To specify a different Ubuntu version:
```sh
docker build --build-arg UBUNTU_VERSION=22.04 -t package-cloud.dns.army/ros2/docker-runner-gitea:jammy-node-24 .
```
Used Ubuntu versions:
| Ubuntu Version | Image Tag |
|----------------|-----------------------------------|
| 24.04 (noble) | docker-runner-gitea:noble-node-24 |
| 22.04 (jammy) | docker-runner-gitea:jammy-node-24 |
| 20.04 (focal) | docker-runner-gitea:focal-node-24 |
### Running a Container
```sh
docker run -it package-cloud.dns.army/ros2/docker-runner-gitea:noble-node-24 /bin/bash
```
### Using as a Gitea Runner
Configure this image in your Gitea instance for CI/CD pipelines by specifying the image name in your runner configuration.
## Installed Packages
| Package | Version | Purpose |
|-----------------|---------|-----------------------|
| Node.js | 24.11.1 | JavaScript runtime |
| Python | 3.x | Scripting and tools |
| Conan | Latest | C/C++ package manager |
| Git | Latest | Version control |
| build-essential | Latest | Compilation tools |
Notes
- The image uses NVM (Node Version Manager) for flexible Node.js version management
- Pip packages are installed with --break-system-packages flag for Python 3
- All apt cache is cleaned to minimize image size