2 Commits

Author SHA1 Message Date
ea482aa61f fix: cache dnf installs (and remove cache from images) 2025-12-29 17:10:28 +01:00
4bf4addd5a ci: move ci to job v2 2025-12-29 17:09:24 +01:00
21 changed files with 177 additions and 130 deletions

View File

@@ -13,7 +13,10 @@ jobs:
runs-on: job-v2 runs-on: job-v2
outputs: outputs:
any_change: ${{ steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}} any_change: ${{ steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}}
base: ${{ steps.filter.outputs.base == 'true' }} fedora: ${{ steps.filter.outputs.fedora == 'true' }}
php: ${{ steps.filter.outputs.php == 'true' }}
rust: ${{ steps.filter.outputs.rust == 'true' }}
dotnet: ${{ steps.filter.outputs.dotnet == 'true' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: https://github.com/dorny/paths-filter@v3 - uses: https://github.com/dorny/paths-filter@v3
@@ -21,11 +24,14 @@ jobs:
with: with:
filters: | filters: |
workflow: ['.gitea/workflows/build.yaml'] workflow: ['.gitea/workflows/build.yaml']
base: ['containers/base/**'] fedora: ['containers/fedora/**']
php: ['containers/php/**']
rust: ['containers/rust/**']
dotnet: ['containers/dotnet/**']
base-image: base-image:
needs: [changes] needs: [changes]
if: ${{ needs.changes.outputs.base == 'true' || needs.changes.outputs.any_change == 'true' }} if: ${{ needs.changes.outputs.fedora == 'true' || needs.changes.outputs.any_change == 'true' }}
runs-on: job-v2 runs-on: job-v2
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -39,10 +45,10 @@ jobs:
id: build id: build
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
with: with:
image: maurice/base image: maurice/fedora
tags: ${{ github.ref_name }} tags: ${{ github.ref_name }}
context: ./containers/base context: ./containers/fedora
containerfiles: ./containers/base/Containerfile containerfiles: ./containers/fedora/Containerfile
- name: Push - name: Push
uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
with: with:
@@ -55,51 +61,100 @@ jobs:
--compression-format=zstd --compression-format=zstd
--compression-level=12 --compression-level=12
# dependent-images: dependent-images:
# needs: [changes, base-image] needs: [changes, base-image]
# if: always() && needs.changes.result == 'success' && (needs.base-image.result == 'success' || needs.base-image.result == 'skipped') if: always() && needs.changes.result == 'success' && (needs.base-image.result == 'success' || needs.base-image.result == 'skipped')
# runs-on: job-v2 runs-on: job-v2
# strategy: strategy:
# fail-fast: false fail-fast: false
# matrix: matrix:
# container: [rust, dotnet, go] container: [php, rust, dotnet]
# steps: steps:
# - name: Check if build needed - name: Check if build needed
# id: check id: check
# run: | run: |
# if [[ "${{ matrix.container }}" == "go" && "${{ needs.changes.outputs.go }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi if [[ "${{ matrix.container }}" == "php" && "${{ needs.changes.outputs.php }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
# if [[ "${{ matrix.container }}" == "rust" && "${{ needs.changes.outputs.rust }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi if [[ "${{ matrix.container }}" == "rust" && "${{ needs.changes.outputs.rust }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
# if [[ "${{ matrix.container }}" == "dotnet" && "${{ needs.changes.outputs.dotnet }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi if [[ "${{ matrix.container }}" == "dotnet" && "${{ needs.changes.outputs.dotnet }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
# if [[ "${{ needs.changes.outputs.any_change }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi if [[ "${{ needs.changes.outputs.any_change }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
# - name: Clone repo - name: Clone repo
# if: steps.check.outputs.run == 'true' if: steps.check.outputs.run == 'true'
# uses: actions/checkout@v4 uses: actions/checkout@v4
# - name: Log in - name: Log in
# if: steps.check.outputs.run == 'true' if: steps.check.outputs.run == 'true'
# uses: redhat-actions/podman-login@v1 uses: redhat-actions/podman-login@v1
# with: with:
# registry: git.plabble.org registry: git.plabble.org
# username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
# password: ${{ secrets.REGISTRY_TOKEN }} password: ${{ secrets.REGISTRY_TOKEN }}
# - name: Build - name: Build
# id: build id: build
# if: steps.check.outputs.run == 'true' if: steps.check.outputs.run == 'true'
# uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
# with: with:
# image: maurice/${{ matrix.container }} image: maurice/${{ matrix.container }}
# tags: ${{ github.ref_name }} tags: ${{ github.ref_name }}
# context: ./containers/${{ matrix.container }} context: ./containers/${{ matrix.container }}
# containerfiles: ./containers/${{ matrix.container }}/Containerfile containerfiles: ./containers/${{ matrix.container }}/Containerfile
# build-args: TAG=${{ github.ref_name }} build-args: TAG=${{ github.ref_name }}
# - name: Push - name: Push
# if: steps.check.outputs.run == 'true' if: steps.check.outputs.run == 'true'
# uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
# with: with:
# image: ${{ steps.build.outputs.image }} image: ${{ steps.build.outputs.image }}
# tags: ${{ steps.build.outputs.tags }} tags: ${{ steps.build.outputs.tags }}
# registry: git.plabble.org registry: git.plabble.org
# username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
# password: ${{ secrets.REGISTRY_TOKEN }} password: ${{ secrets.REGISTRY_TOKEN }}
# extra-args: | extra-args: |
# --compression-format=zstd --compression-format=zstd
# --compression-level=12 --compression-level=12
manual-images:
needs: [changes, base-image]
if: always() && needs.changes.result == 'success' && (needs.base-image.result == 'success' || needs.base-image.result == 'skipped')
runs-on: job-v2
strategy:
fail-fast: false
matrix:
container: [php, rust, dotnet]
steps:
- name: Check if build needed
id: check
run: |
if [[ "${{ matrix.container }}" == "php" && "${{ needs.changes.outputs.php }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
if [[ "${{ matrix.container }}" == "rust" && "${{ needs.changes.outputs.rust }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
if [[ "${{ matrix.container }}" == "dotnet" && "${{ needs.changes.outputs.dotnet }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
if [[ "${{ needs.changes.outputs.any_change }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
- name: Clone repo
if: steps.check.outputs.run == 'true'
uses: actions/checkout@v4
- name: Log in
if: steps.check.outputs.run == 'true'
uses: redhat-actions/podman-login@v1
with:
registry: git.plabble.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build
id: build
if: steps.check.outputs.run == 'true'
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
with:
image: maurice/${{ matrix.container }}
tags: ${{ github.ref_name }}
context: ./containers/${{ matrix.container }}
containerfiles: ./containers/${{ matrix.container }}/Containerfile
build-args: TAG=${{ github.ref_name }}
- name: Push
if: steps.check.outputs.run == 'true'
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: git.plabble.org
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
extra-args: |
--compression-format=zstd
--compression-level=12

View File

@@ -8,7 +8,7 @@ jobs:
strategy: strategy:
max-parallel: 1 max-parallel: 1
matrix: matrix:
container: [rider] container: [rider, android]
steps: steps:
- name: Clone repo - name: Clone repo
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@@ -1,5 +0,0 @@
#!/bin/sh
cd containers/base
podman build -t git.plabble.org/maurice/base:main .
cd ../rider
podman build -t git.plabble.org/maurice/rider:main .

View File

@@ -1,9 +1,9 @@
FROM git.plabble.org/maurice/base:main FROM git.plabble.org/maurice/dotnet:main
ARG studio_version="2025.3.2.6" ARG studio_version="2025.1.4.8"
ARG download_uri="https://redirector.gvt1.com/edgedl/android/studio/ide-zips/${studio_version}/android-studio-${studio_version}-linux.tar.gz" ARG download_uri="https://redirector.gvt1.com/edgedl/android/studio/ide-zips/${studio_version}/android-studio-${studio_version}-linux.tar.gz"
USER root USER root
# === setup GUI ===
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \ RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
dnf -y --setopt=keepcache=1 install libXext libXrender libXtst libX11 freetype freetype-devel mesa-libGLU dnf -y --setopt=keepcache=1 install libXext libXrender libXtst libX11 freetype freetype-devel mesa-libGLU
USER user USER user

View File

@@ -1,53 +0,0 @@
FROM quay.io/fedora/fedora:43
# === install system packages ===
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
dnf update -y && \
dnf -y --setopt=keepcache=1 install \
procps ping bash-completion glibc-langpack-en openssl-devel \
host-spawn dbus-launch \
git pnpm helix zip rsync \
dotnet-sdk-10.0
# === setup user ===
RUN useradd -ms /bin/bash user && \
usermod -aG wheel user && sed -i '/NOPASSWD/s/^#//g' /etc/sudoers && \
mkdir -p /run/user/1000 && chown user:user /run/user/1000
# === Add host entry for podman ===
RUN ln -s /usr/local/bin/host /usr/local/bin/podman
# === root language servers ===
COPY install-roslyn.sh /tmp/install-roslyn.sh
RUN chmod +x /tmp/install-roslyn.sh && /tmp/install-roslyn.sh && rm /tmp/omnisharp.tar.gz && rm /tmp/install-roslyn.sh
# RUN go install golang.org/x/tools/gopls@latest
USER user
WORKDIR /home/user
RUN mkdir .config .local .cache
COPY --chown=user:user config/bashrc .bashrc
COPY --chown=user:user config/git .config/git/config
COPY --chown=user:user config/helix/ .config/helix/
COPY config/bin /usr/local/bin
# === Setup PNPM & install language servers, tools ===
RUN /bin/bash -c ". /home/user/.bashrc && pnpm setup && . /home/user/.bashrc && pnpm i -g deno bash-language-server vscode-langservers-extracted dockerfile-language-server-nodejs \
typescript typescript-language-server"
RUN dotnet tool install --global dotnet-ef && \
echo 'export PATH="$PATH:/home/user/.dotnet/tools:/home/user/.cargo/env"' >> /home/user/.bashrc
# === Rust, WASM toolchain ===
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN . /home/user/.bashrc && rustup component add rust-analyzer && \
curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | sh && \
cargo install cargo-generate && \
cargo install cargo-expand
# === Cleanup build dependencies ===
USER root
RUN dnf remove -y openssl-devel && dnf clean all && rm -rf /home/user/.cargo
USER user
VOLUME /home/user

View File

@@ -0,0 +1,11 @@
FROM git.plabble.org/maurice/fedora:main
USER root
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
dnf -y --setopt=keepcache=1 install dotnet-sdk-9.0 dotnet-sdk-10.0
COPY install-roslyn.sh /tmp/install-roslyn.sh
RUN chmod +x /tmp/install-roslyn.sh && /tmp/install-roslyn.sh
USER user
RUN dotnet tool install --global dotnet-ef

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
version="v1.39.15" version="v1.39.15-beta.60"
arch="linux-x64" arch="linux-x64"
link="https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$version/omnisharp-$arch-net6.0.tar.gz" link="https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$version/omnisharp-$arch-net6.0.tar.gz"

View File

@@ -0,0 +1,31 @@
FROM quay.io/fedora/fedora:43
# === install system packages ===
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
dnf update -y && \
dnf -y --setopt=keepcache=1 install procps ping bash-completion glibc-langpack-en \
host-spawn dbus-launch \
git pnpm helix zip
# === setup user ===
RUN useradd -ms /bin/bash user && \
usermod -aG wheel user && sed -i '/NOPASSWD/s/^#//g' /etc/sudoers && \
mkdir -p /run/user/1000 && chown user:user /run/user/1000
# === Add host entry for podman ===
RUN ln -s /usr/local/bin/host /usr/local/bin/podman
USER user
WORKDIR /home/user
RUN mkdir .config .local .cache
COPY --chown=user:user config/bashrc .bashrc
COPY --chown=user:user config/git .config/git/config
COPY --chown=user:user config/helix/ .config/helix/
COPY config/bin /usr/local/bin
# === Setup PNPM & install language servers ===
RUN /bin/bash -c "SHELL=/bin/bash pnpm setup && . /home/user/.bashrc && pnpm i -g deno bash-language-server vscode-langservers-extracted dockerfile-language-server-nodejs \
typescript typescript-language-server"
VOLUME /home/user

View File

@@ -0,0 +1,2 @@
#!/bin/bash
arg "-p 5173:5173 --network dev-php"

View File

@@ -1,5 +1,5 @@
FROM git.plabble.org/maurice/base:main FROM git.plabble.org/maurice/android:main
ARG flutter_version="3.41.4-stable" ARG flutter_version="3.35.7-stable"
ARG download_uri="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${flutter_version}.tar.xz" ARG download_uri="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${flutter_version}.tar.xz"
RUN mkdir /home/user/Flutter && \ RUN mkdir /home/user/Flutter && \

View File

@@ -0,0 +1,4 @@
FROM git.plabble.org/maurice/fedora:main
ARG php_version="8.5"
RUN /bin/bash -c "export TERM=xterm && $(curl -fsSL https://php.new/install/linux/${php_version})"

2
containers/php/config.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
arg "--cap-add=NET_BIND_SERVICE -p 80:80"

View File

@@ -1,10 +1,8 @@
FROM git.plabble.org/maurice/base:main FROM git.plabble.org/maurice/dotnet:main
ARG rider_version="2025.3.3" ARG rider_version="2025.3.0.3"
ARG download_uri="https://download.jetbrains.com/rider/JetBrains.Rider-${rider_version}.tar.gz" ARG download_uri="https://download.jetbrains.com/rider/JetBrains.Rider-${rider_version}.tar.gz"
USER root USER root
# === setup GUI ===
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \ RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
dnf -y --setopt=keepcache=1 install libXext libXrender libXtst libX11 freetype freetype-devel dnf -y --setopt=keepcache=1 install libXext libXrender libXtst libX11 freetype freetype-devel
USER user USER user

View File

@@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
mkdir -p /tmp/joypet-sockets arg "-p 8080:8080"
arg "-p 7777:7777" arg "-p 8081:8081"
arg "-v /tmp/joypet-sockets:/var/run/joypet-sockets:Z"

View File

@@ -0,0 +1,4 @@
FROM git.plabble.org/maurice/fedora:main
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN . '/home/user/.cargo/env' && rustup component add rust-analyzer

View File

@@ -16,7 +16,7 @@ default_args() {
arg "--hostname $name" arg "--hostname $name"
# Pull newer container image if available. # Pull newer container image if available.
# arg "--pull=newer" arg "--pull=newer"
# Use keep-id so the container user matches the host user. # Use keep-id so the container user matches the host user.
arg "--userns=keep-id" arg "--userns=keep-id"
@@ -57,8 +57,8 @@ param_args() {
arg "-v /run/user/$UID/bus:/tmp/bus" arg "-v /run/user/$UID/bus:/tmp/bus"
arg "-e HOST_HOME=$HOME" # Used to translate paths. arg "-e HOST_HOME=$HOME" # Used to translate paths.
;; ;;
-net) # Enable network 'dev-<container name>'' and 'devc' -net) # Enable network dev-<container name>
arg "--network dev-$name --network devc" arg "--network dev-$name"
;; ;;
-mnt) # Mount directory. -mnt) # Mount directory.
shift shift
@@ -117,7 +117,6 @@ fi
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then
log "starting devcontainer..." log "starting devcontainer..."
podman network create --ignore "dev-$name" podman network create --ignore "dev-$name"
podman network create --ignore "devc"
podman container rm -f -t 0 "$name" 1>/dev/null podman container rm -f -t 0 "$name" 1>/dev/null
podman run -td $(default_args) $(param_args $@) "$registry/$image" podman run -td $(default_args) $(param_args $@) "$registry/$image"
fi fi