diff --git a/.forgejo/workflows/build-fedora-40.yml b/.forgejo/workflows/build-fedora-40.yml index 2bf1e64..5c87319 100644 --- a/.forgejo/workflows/build-fedora-40.yml +++ b/.forgejo/workflows/build-fedora-40.yml @@ -21,20 +21,26 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: 'package.json' - name: Fulfill Package Manager Cache run: dnf makecache -y --releasever 40 - name: Sign in to Image Index run: buildah login code.lightstands.xyz --username ${{ env.GITHUB_ACTOR }} --password ${{ secrets.PUBLICATION_TOKEN }} - name: Build Minimal Images - run: DNF_CACHE_PATH=/var/cache/dnf bun shared/build-image.ts code.lightstands.xyz/standcoded/fedora-minimal:40 fedora-40-minimal aarch64 + run: | + cd fedora-40-minimal && \ + buildah manifest create code.lightstands.xyz/standcoded/fedora-minimal:40 && \ + buildah build --arch aarch64 \ + --pid=host --ipc=host --network=host --userns=host --uts=host -v /var/cache/dnf:/var/cache/dnf \ + --manifest code.lightstands.xyz/standcoded/fedora-minimal:40 . - name: Push Minimal Images run: buildah manifest push code.lightstands.xyz/standcoded/fedora-minimal:40 --all - name: Build Complete Images - run: DNF_CACHE_PATH=/var/cache/dnf bun shared/build-image.ts code.lightstands.xyz/standcoded/fedora:40 fedora-40 aarch64 + run: | + cd fedora-40 && \ + buildah manifest create code.lightstands.xyz/standcoded/fedora:40 && \ + buildah build --arch aarch64 \ + --pid=host --ipc=host --network=host --userns=host --uts=host -v /var/cache/dnf:/var/cache/dnf \ + --manifest code.lightstands.xyz/standcoded/fedora:40 . - name: Push Complete Images run: buildah manifest push code.lightstands.xyz/standcoded/fedora:40 --all diff --git a/.forgejo/workflows/build-fedora-41.yml b/.forgejo/workflows/build-fedora-41.yml deleted file mode 100644 index 212d68a..0000000 --- a/.forgejo/workflows/build-fedora-41.yml +++ /dev/null @@ -1,40 +0,0 @@ - -$schema: https://github.com/SchemaStore/schemastore/raw/master/src/schemas/json/github-workflow.json - -on: - push: - branches: ['master'] - paths: - - "fedora-41/**" - - "fedora-41-minimal/**" - - "shared/**" - - ".forgejo/workflows/build-fedora-41.yml" - schedule: - - cron: "0 0 * * 3" # Every Thursday 00:00 - - -jobs: - build: - runs-on: linux-lg - container: - image: code.lightstands.xyz/standcoded/fedora-minimal:40 - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: 'package.json' - - name: Fulfill Package Manager Cache - run: dnf makecache -y --releasever 41 - - name: Sign in to Image Index - run: buildah login code.lightstands.xyz --username ${{ env.GITHUB_ACTOR }} --password ${{ secrets.PUBLICATION_TOKEN }} - - name: Build Minimal Images - run: DNF_CACHE_PATH=/var/cache/dnf bun shared/build-image.ts code.lightstands.xyz/standcoded/fedora-minimal:41 fedora-41-minimal - - name: Push Minimal Images - run: buildah manifest push code.lightstands.xyz/standcoded/fedora-minimal:41 --all - - name: Build Complete Images - run: DNF_CACHE_PATH=/var/cache/dnf bun shared/build-image.ts code.lightstands.xyz/standcoded/fedora:41 fedora-41 - - name: Push Complete Images - run: buildah manifest push code.lightstands.xyz/standcoded/fedora:41 --all - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9b1ee42..0000000 --- a/.gitignore +++ /dev/null @@ -1,175 +0,0 @@ -# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore - -# Logs - -logs -_.log -npm-debug.log_ -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Caches - -.cache - -# Diagnostic reports (https://nodejs.org/api/report.html) - -report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json - -# Runtime data - -pids -_.pid -_.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover - -lib-cov - -# Coverage directory used by tools like istanbul - -coverage -*.lcov - -# nyc test coverage - -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) - -.grunt - -# Bower dependency directory (https://bower.io/) - -bower_components - -# node-waf configuration - -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) - -build/Release - -# Dependency directories - -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) - -web_modules/ - -# TypeScript cache - -*.tsbuildinfo - -# Optional npm cache directory - -.npm - -# Optional eslint cache - -.eslintcache - -# Optional stylelint cache - -.stylelintcache - -# Microbundle cache - -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history - -.node_repl_history - -# Output of 'npm pack' - -*.tgz - -# Yarn Integrity file - -.yarn-integrity - -# dotenv environment variable files - -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) - -.parcel-cache - -# Next.js build output - -.next -out - -# Nuxt.js build / generate output - -.nuxt -dist - -# Gatsby files - -# Comment in the public line in if your project uses Gatsby and not Next.js - -# https://nextjs.org/blog/next-9-1#public-directory-support - -# public - -# vuepress build output - -.vuepress/dist - -# vuepress v2.x temp and cache directory - -.temp - -# Docusaurus cache and generated files - -.docusaurus - -# Serverless directories - -.serverless/ - -# FuseBox cache - -.fusebox/ - -# DynamoDB Local files - -.dynamodb/ - -# TernJS port file - -.tern-port - -# Stores VSCode versions used for testing VSCode extensions - -.vscode-test - -# yarn v2 - -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -# IntelliJ based IDEs -.idea - -# Finder (MacOS) folder config -.DS_Store diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 0ff98e9..cce6f30 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,8 @@ These images is cached on action runner machines and is able to run most of the | Name | OS and Distro | Description | Note | | - | - | - | - | -| `fedora:41` | Fedora 41 | [Description](./fedora-41/README.md) | | -| `fedora-minimal:41` | Fedora 41 | [Description](./fedora-41-minimal/README.md) | | -| `fedora:40` | Fedora 40 | [Description](./fedora-40/README.md) | Deprecated, will be removed after June 2025 | -| `fedora-minimal:40` | Fedora 40 | [Description](./fedora-40-minimal/README.md) | Deprecated, will be removed after June 2025 | +| `fedora:40` | Fedora 40 | [Description](./fedora-40/README.md) | | +| `fedora-minimal:40` | Fedora 40 | [Description](./fedora-40-minimal/README.md) | | ## FAQ diff --git a/bun.lockb b/bun.lockb deleted file mode 100755 index e110007..0000000 Binary files a/bun.lockb and /dev/null differ diff --git a/fedora-40-minimal/Containerfile b/fedora-40-minimal/Containerfile index 0b85597..cc6bbc2 100644 --- a/fedora-40-minimal/Containerfile +++ b/fedora-40-minimal/Containerfile @@ -1,12 +1,61 @@ FROM fedora:40 -RUN sh /imgbuild/fedora/instpkgs-minimal.sh +RUN dnf update -y --setopt install_weak_deps=False + +RUN dnf install -y --setopt install_weak_deps=False git git-lfs git-ftp fuse-overlayfs + +RUN dnf install -y --setopt install_weak_deps=False nodejs nodejs-npm python3-devel python3-pip pipx + +RUN dnf install -y --setopt install_weak_deps=False perl perl-CPAN ruby rubygems + +RUN dnf install -y --setopt install_weak_deps=False clang gcc + +RUN dnf install -y --setopt install_weak_deps=False coreutils bash aria2 jq yq zstd brotli sqlite + +RUN dnf install -y --setopt install_weak_deps=False buildah podman --exclude container-selinux # We don't clean up dnf cache since user may want to install packages for their use ADD containers.conf /etc/containers/ -RUN sh /imgbuild/configure-nested-container.sh +# Copy & modify the defaults to provide reference if runtime changes needed. +# Changes here are required for running with fuse-overlay storage inside container. +RUN sed -e 's|^#mount_program|mount_program|g' \ + -e '/additionalimage.*/a "/var/lib/shared",' \ + -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \ + /usr/share/containers/storage.conf \ + > /etc/containers/storage.conf && \ + chmod 644 /etc/containers/storage.conf && \ + chmod 644 /etc/containers/containers.conf + +RUN mkdir -p /var/lib/shared/overlay-images \ + /var/lib/shared/overlay-layers \ + /var/lib/shared/vfs-images \ + /var/lib/shared/vfs-layers && \ + touch /var/lib/shared/overlay-images/images.lock && \ + touch /var/lib/shared/overlay-layers/layers.lock && \ + touch /var/lib/shared/vfs-images/images.lock && \ + touch /var/lib/shared/vfs-layers/layers.lock + +# Define uid/gid ranges for our user https://github.com/containers/buildah/issues/3053 +RUN useradd action && \ + echo -e "action:1:999\action:1001:64535" > /etc/subuid && \ + echo -e "action:1:999\action:1001:64535" > /etc/subgid && \ + mkdir -p /home/action/.local/share/containers && \ + mkdir -p /home/action/.config/containers && \ + chown -R action:action /home/action + +# See: https://github.com/containers/buildah/issues/4669 +# Copy & modify the config for the `action` user and remove the global +# `runroot` and `graphroot` which current `actuib` user cannot access, +# in such case storage will choose a runroot in `/var/tmp`. +RUN sed -e 's|^#mount_program|mount_program|g' \ + -e 's|^graphroot|#graphroot|g' \ + -e 's|^runroot|#runroot|g' \ + /etc/containers/storage.conf \ + > /home/action/.config/containers/storage.conf && \ + chown action:action /home/action/.config/containers/storage.conf + VOLUME /var/lib/containers VOLUME /home/action/.local/share/containers diff --git a/fedora-41-minimal/Containerfile b/fedora-41-minimal/Containerfile deleted file mode 100644 index 306e8c3..0000000 --- a/fedora-41-minimal/Containerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM fedora:41 - -RUN sh /imgbuild/fedora/instpkgs-minimal.sh - -# We don't clean up dnf cache since user may want to install packages for their use - -ADD containers.conf /etc/containers/ - -RUN sh /imgbuild/configure-nested-container.sh - -VOLUME /var/lib/containers -VOLUME /home/action/.local/share/containers - -# Set up environment variables to note that this is -# not starting with usernamespace and default to -# isolate the filesystem with chroot. -ENV _BUILDAH_STARTED_IN_USERNS="" BUILDAH_ISOLATION=chroot - -ENTRYPOINT [ "/bin/bash" ] diff --git a/fedora-41-minimal/README.md b/fedora-41-minimal/README.md deleted file mode 100644 index 8ab0a5d..0000000 --- a/fedora-41-minimal/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# fedora-minimal:41 - -```yaml -container: - image: code.lightstands.xyz/standcoded/fedora-minimal:41 -``` - -## Included Softwares - -### General - -- coreutils -- bash -- aria2 -- jq -- yq -- zstd -- brotil -- sqlite - -### Version Control - -- git -- git-lfs -- git-ftp - -### Container Management - -- podman -- buildah -- fuse-overlayfs - -### NodeJS - -- nodejs -- nodejs-npm - -### Python - -- python3 -- python3-devel -- python3-pip -- pipx - -### Perl - -- perl -- perl-CPAN - -### Ruby - -- ruby -- rubygems - -### C - -- clang -- gcc - -## Additional Configuration - -### Building Container Images - -This images configured buildah to be correctly run under a container. You can use [The workflow of this project](../.forgejo/workflows/build-fedora-41.yml) as an example. diff --git a/fedora-41-minimal/containers.conf b/fedora-41-minimal/containers.conf deleted file mode 100644 index 0bf45cd..0000000 --- a/fedora-41-minimal/containers.conf +++ /dev/null @@ -1,2 +0,0 @@ -[engine] -cgroup_manager = "cgroupfs" diff --git a/fedora-41/Containerfile b/fedora-41/Containerfile deleted file mode 100644 index b29ee3b..0000000 --- a/fedora-41/Containerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM code.lightstands.xyz/standcoded/fedora-minimal:41 - -RUN dnf install -y --setopt install_weak_deps=False sqlite-devel binutils - -RUN dnf install -y --setopt install_weak_deps=False nodejs-devel poetry perl-devel ruby-devel - -RUN dnf install -y --setopt install_weak_deps=False php php-devel composer - -RUN dnf install -y --setopt install_weak_deps=False java-1.8.0-openjdk java-1.8.0-openjdk-devel - -RUN dnf install -y --setopt install_weak_deps=False java-11-openjdk java-11-openjdk-devel - -RUN dnf install -y --setopt install_weak_deps=False java-17-openjdk java-17-openjdk-devel - -RUN dnf install -y --setopt install_weak_deps=False java-21-openjdk java-21-openjdk-devel - -RUN dnf install -y --setopt install_weak_deps=False qemu-user-static qemu-user-binfmt - -RUN dnf install -y --setopt install_weak_deps=False bison flex vcpkg - -RUN dnf group install -y --setopt install_weak_deps=False "C Development Tools and Libraries" - -RUN npm -g install corepack diff --git a/fedora-41/README.md b/fedora-41/README.md deleted file mode 100644 index 8440282..0000000 --- a/fedora-41/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# fedora:41 - -```yaml -container: - image: code.lightstands.xyz/standcoded/fedora:40 -``` - -## Included Softwares - -### General - -- coreutils -- bash -- aria2 -- jq -- yq -- zstd -- brotil -- sqlite -- sqlite-devel -- binutils - -### Version Control - -- git -- git-lfs -- git-ftp - -### Container Management - -- podman -- buildah -- fuse-overlayfs -- qemu-user-static -- qemu-user-binfmt - -### NodeJS - -- nodejs -- nodejs-npm -- nodejs-devel -- corepack - -### Python - -- python3-devel -- python3-pip -- pipx -- poetry - -### Perl - -- perl -- perl-CPAN -- perl-devel - -### Ruby - -- ruby -- rubygems -- ruby-devel - -### C/C++ - -- clang -- gcc -- bison -- flex -- "C Development Tools and Libraries" -- vcpkg - -### PHP - -- php -- php-devel -- composer - -### Java - -| Version | Packages | -| - | - | -| 1.8.0 | java-1.8.0-openjdk, java-1.8.0-openjdk-devel | -| 11 | java-11-openjdk, java-11-openjdk-devel | -| 17 | java-17-openjdk, java-17-openjdk-devel | -| 21 | java-21-openjdk, java-21-openjdk-devel | - -## Additional Configuration - -### Building Container Images - -This images configured buildah to be correctly run under a container. You can use [The workflow of this project](../.forgejo/workflows/build-fedora-41.yml) as an example. diff --git a/package.json b/package.json deleted file mode 100644 index 42d98da..0000000 --- a/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "runner-images", - "private": "true", - "type": "module", - "devDependencies": { - "@types/bun": "latest" - }, - "peerDependencies": { - "typescript": "^5.0.0" - }, - "packageManager": "bun@1.1.36" -} \ No newline at end of file diff --git a/shared/build-image.ts b/shared/build-image.ts deleted file mode 100644 index 6e134d3..0000000 --- a/shared/build-image.ts +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bun -const $ = Bun.$; - -const sharedDir = import.meta.dir; -const tag = process.argv[2]; -const dirName = process.argv[3]; -const arches = process.argv[4].split(","); -const pathToDnfCache = process.env["DNF_CACHE_PATH"]; - -await $`buildah manifest create ${tag}`; -for (const arch of arches) { - await $`buildah build --arch ${arch} \ - --pid=host --ipc=host --network=host --userns=host \ - --uts=host ${pathToDnfCache ? `-v /var/cache/dnf:/var/cache/dnf` : ""} \ - --manifest code.lightstands.xyz/standcoded/${tag} \ - --volume ${sharedDir}:/imgbuild:z ${dirName}`; -} diff --git a/shared/configure-nested-container.sh b/shared/configure-nested-container.sh deleted file mode 100644 index f6e7a2a..0000000 --- a/shared/configure-nested-container.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# Copy & modify the defaults to provide reference if runtime changes needed. -# Changes here are required for running with fuse-overlay storage inside container. -sed -e 's|^#mount_program|mount_program|g' \ - -e '/additionalimage.*/a "/var/lib/shared",' \ - -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \ - /usr/share/containers/storage.conf \ - > /etc/containers/storage.conf && \ - chmod 644 /etc/containers/storage.conf && \ - chmod 644 /etc/containers/containers.conf - -mkdir -p /var/lib/shared/overlay-images \ - /var/lib/shared/overlay-layers \ - /var/lib/shared/vfs-images \ - /var/lib/shared/vfs-layers && \ - touch /var/lib/shared/overlay-images/images.lock && \ - touch /var/lib/shared/overlay-layers/layers.lock && \ - touch /var/lib/shared/vfs-images/images.lock && \ - touch /var/lib/shared/vfs-layers/layers.lock - -# Define uid/gid ranges for our user https://github.com/containers/buildah/issues/3053 -useradd action && \ - echo -e "action:1:999\action:1001:64535" > /etc/subuid && \ - echo -e "action:1:999\action:1001:64535" > /etc/subgid && \ - mkdir -p /home/action/.local/share/containers && \ - mkdir -p /home/action/.config/containers && \ - chown -R action:action /home/action - -# See: https://github.com/containers/buildah/issues/4669 -# Copy & modify the config for the `action` user and remove the global -# `runroot` and `graphroot` which current `actuib` user cannot access, -# in such case storage will choose a runroot in `/var/tmp`. -sed -e 's|^#mount_program|mount_program|g' \ - -e 's|^graphroot|#graphroot|g' \ - -e 's|^runroot|#runroot|g' \ - /etc/containers/storage.conf \ - > /home/action/.config/containers/storage.conf && \ - chown action:action /home/action/.config/containers/storage.conf \ No newline at end of file diff --git a/shared/fedora/instpkgs-minimal.sh b/shared/fedora/instpkgs-minimal.sh deleted file mode 100644 index 989c429..0000000 --- a/shared/fedora/instpkgs-minimal.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -dnf update -y --setopt install_weak_deps=False && \ -dnf install -y --setopt install_weak_deps=False git git-lfs git-ftp fuse-overlayfs \ - nodejs nodejs-npm python3-devel python3-pip pipx \ - perl perl-CPAN ruby rubygems \ - clang gcc \ - coreutils bash aria2 jq yq zstd brotli sqlite \ - buildah podman \ - --exclude container-selinux diff --git a/shared/install-vcpkg.sh b/shared/install-vcpkg.sh new file mode 100644 index 0000000..bf1ea59 --- /dev/null +++ b/shared/install-vcpkg.sh @@ -0,0 +1,4 @@ +# https://learn.microsoft.com/zh-cn/vcpkg/get_started/get-started?pivots=shell-cmd + +echo TODO +exit 1 \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 3064c7a..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - // Enable latest features - "lib": ["ESNext", "DOM"], - "target": "ESNext", - "module": "ESNext", - "moduleDetection": "force", - "allowJs": true, - - // Bundler mode - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "verbatimModuleSyntax": true, - "noEmit": true, - - // Best practices - "strict": true, - "skipLibCheck": true, - "noFallthroughCasesInSwitch": true, - - // Some stricter flags (disabled by default) - "noUnusedLocals": false, - "noUnusedParameters": false, - "noPropertyAccessFromIndexSignature": false - }, - "include": [ - "./**/**.ts", "./**/**.js" - ] -}