From 6fbb8bd631880f4b8ca0472ddbb9c82054dac287 Mon Sep 17 00:00:00 2001 From: Martin Riedl Date: Fri, 28 Mar 2025 23:39:14 +0100 Subject: [PATCH] feat: new ubuntu 24.04 image --- .forgejo/workflows/build.yml | 62 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + README.md | 9 +++++ images/ubuntu/24.04/Dockerfile | 11 ++++++ 4 files changed, 83 insertions(+) create mode 100644 .forgejo/workflows/build.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 images/ubuntu/24.04/Dockerfile diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..671bd6a --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,62 @@ +name: Build + +on: + schedule: + - cron: '30 4 * * 6' + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: docker + container: debian:12 + permissions: + packages: write + strategy: + matrix: + images: + - name: ubuntu + tag: 24.04 + steps: + - name: Install NodeJS + shell: sh + run: | + apt-get update && apt-get install -y curl + curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh && bash nodesource_setup.sh + apt-get install -y nodejs + node -v + # https://docs.docker.com/engine/install/debian/#install-using-the-repository + - name: Install Docker + shell: sh + run: | + apt-get install ca-certificates curl + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + apt-get update && apt-get install -y docker-ce-cli docker-buildx-plugin + - name: Checkout code + uses: actions/checkout@v4 + - name: Extract Registry Hostname + shell: bash + run: | + SERVER_URL="${{ github.server_url }}" + HOSTNAME="${SERVER_URL#https://}" + echo "Hostname: HOSTNAME" + echo "DOCKER_REGISTRY_HOST=$HOSTNAME" >> "$GITHUB_ENV" + - name: Login to Forgejo Registry + uses: docker/login-action@v3 + with: + registry: ${{ github.server_url }} + username: ${{ vars.CONTAINER_USER }} + password: ${{ secrets.CONTAINER_PASSWORD }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: ./images/${{ matrix.images.name }}/${{ matrix.images.tag }} + push: true + tags: ${{ env.DOCKER_REGISTRY_HOST }}/${{ github.repository_owner }}/${{ matrix.images.name }}:${{ matrix.images.tag }} + no-cache: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..664d337 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Images + +## Ubuntu 24.04 + +https://git.martin-riedl.de/ci/-/packages/container/ubuntu/24.04 + +### Pre-Installed Software + +- nodejs 22 diff --git a/images/ubuntu/24.04/Dockerfile b/images/ubuntu/24.04/Dockerfile new file mode 100644 index 0000000..c157f63 --- /dev/null +++ b/images/ubuntu/24.04/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* + +# install nodejs +RUN apt-get update && apt-get install -y --no-install-recommends curl && \ + curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh && \ + bash nodesource_setup.sh && \ + apt-get install -y --no-install-recommends nodejs && \ + rm -rf /var/lib/apt/lists/* && \ + node -v