Compare commits
10 Commits
bb6ae4a2a1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
8f761565d0
|
|||
|
86e3275c67
|
|||
|
e6bd3f3524
|
|||
|
4e1737f5b3
|
|||
|
32bbe1c2cd
|
|||
|
678b8bee6e
|
|||
|
0d3d5d5b36
|
|||
|
8bde490c6d
|
|||
|
cdbb4de204
|
|||
|
9b81bc8c68
|
@@ -1,5 +1,6 @@
|
|||||||
name: Build containers
|
name: Build containers
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths: ["containers/**", ".gitea/workflows/build.yaml"]
|
paths: ["containers/**", ".gitea/workflows/build.yaml"]
|
||||||
@@ -16,7 +17,8 @@ jobs:
|
|||||||
fedora: ${{ steps.filter.outputs.fedora == 'true' }}
|
fedora: ${{ steps.filter.outputs.fedora == 'true' }}
|
||||||
infra: ${{ steps.filter.outputs.infra == 'true' || steps.filter.outputs.fedora == 'true' }}
|
infra: ${{ steps.filter.outputs.infra == 'true' || steps.filter.outputs.fedora == 'true' }}
|
||||||
go: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.fedora == 'true' }}
|
go: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.fedora == 'true' }}
|
||||||
any_change: ${{ steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' }}
|
php: ${{ steps.filter.outputs.php == 'true' || steps.filter.outputs.fedora == 'true' }}
|
||||||
|
any_change: ${{ steps.filter.outputs.workflow == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}}
|
||||||
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
|
||||||
@@ -27,14 +29,14 @@ jobs:
|
|||||||
fedora: ['containers/fedora/**']
|
fedora: ['containers/fedora/**']
|
||||||
infra: ['containers/infra/**']
|
infra: ['containers/infra/**']
|
||||||
go: ['containers/go/**']
|
go: ['containers/go/**']
|
||||||
|
php: ['containers/php/**']
|
||||||
|
|
||||||
base-image:
|
base-image:
|
||||||
needs: [changes]
|
needs: [changes]
|
||||||
|
if: ${{ needs.changes.outputs.fedora == 'true' || needs.changes.outputs.any_change == 'true' }}
|
||||||
runs-on: job-v2
|
runs-on: job-v2
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repo
|
- uses: actions/checkout@v4
|
||||||
if: ${{ needs.changes.outputs.fedora == 'true' || needs.changes.outputs.any_change == 'true' }}
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Log in
|
- name: Log in
|
||||||
uses: redhat-actions/podman-login@v1
|
uses: redhat-actions/podman-login@v1
|
||||||
with:
|
with:
|
||||||
@@ -49,7 +51,6 @@ jobs:
|
|||||||
tags: ${{ github.ref_name }}
|
tags: ${{ github.ref_name }}
|
||||||
context: ./containers/fedora
|
context: ./containers/fedora
|
||||||
containerfiles: ./containers/fedora/Containerfile
|
containerfiles: ./containers/fedora/Containerfile
|
||||||
oci: true
|
|
||||||
- name: Push
|
- name: Push
|
||||||
uses: redhat-actions/push-to-registry@v2
|
uses: redhat-actions/push-to-registry@v2
|
||||||
with:
|
with:
|
||||||
@@ -59,22 +60,24 @@ jobs:
|
|||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
extra-args: |
|
extra-args: |
|
||||||
--compression-format=zstd:chunked
|
--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')
|
||||||
runs-on: job-v2
|
runs-on: job-v2
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
container: [infra, go]
|
container: [infra, go, php]
|
||||||
steps:
|
steps:
|
||||||
- name: Check if build needed
|
- name: Check if build needed
|
||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ matrix.container }}" == "infra" && "${{ needs.changes.outputs.infra }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
if [[ "${{ matrix.container }}" == "infra" && "${{ needs.changes.outputs.infra }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
||||||
if [[ "${{ matrix.container }}" == "go" && "${{ needs.changes.outputs.go }}" == "true" ]]; then echo "run=true" >> $GITHUB_OUTPUT; fi
|
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 [[ "${{ 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'
|
||||||
@@ -96,7 +99,6 @@ jobs:
|
|||||||
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 }}
|
||||||
oci: true
|
|
||||||
- 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
|
||||||
@@ -107,5 +109,5 @@ jobs:
|
|||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
extra-args: |
|
extra-args: |
|
||||||
--compression-format=zstd:chunked
|
--compression-format=zstd
|
||||||
--compression-level=12
|
--compression-level=12
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
FROM quay.io/fedora/fedora:43
|
FROM quay.io/fedora/fedora:43
|
||||||
|
|
||||||
# === install system packages ===
|
# === install system packages ===
|
||||||
RUN dnf update -y && \
|
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
||||||
|
dnf update -y && \
|
||||||
dnf copr enable -y atim/lazygit && \
|
dnf copr enable -y atim/lazygit && \
|
||||||
dnf -y install procps ping bash-completion glibc-langpack-en \
|
dnf -y --setopt=keepcache=1 install procps ping bash-completion glibc-langpack-en \
|
||||||
host-spawn dbus-launch \
|
host-spawn dbus-launch \
|
||||||
zoxide git npm neovim awk jq unzip fd-find lazygit && \
|
zoxide git npm neovim awk jq unzip fd-find lazygit
|
||||||
dnf clean all
|
|
||||||
|
|
||||||
# === setup user ===
|
# === setup user ===
|
||||||
RUN useradd -ms /bin/bash user && \
|
RUN useradd -ms /bin/bash user && echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers && mkdir -p /run/user/1000 && chown user:user /run/user/1000
|
||||||
echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers && \
|
|
||||||
mkdir -p /run/user/1000 && chown user:user /run/user/1000
|
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
WORKDIR /home/user
|
WORKDIR /home/user
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
ARG TAG
|
ARG TAG
|
||||||
FROM git.plabble.org/job79/fedora:${TAG}
|
FROM job79/fedora:${TAG}
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN dnf -y install go
|
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
||||||
|
dnf -y --setopt=keepcache=1 install go
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
ARG TAG
|
ARG TAG
|
||||||
FROM git.plabble.org/job79/fedora:${TAG}
|
FROM job79/fedora:${TAG}
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN dnf -y install kubectl k9s openssl age "$(curl -s https://api.github.com/repos/getsops/sops/releases/latest | jq -r '.assets[] | select(.name | test("sops-.*.x86_64.rpm$")) | .browser_download_url')" && \
|
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
||||||
dnf clean all && \
|
dnf -y --setopt=keepcache=1 install kubectl k9s openssl age "$(curl -s https://api.github.com/repos/getsops/sops/releases/latest | jq -r '.assets[] | select(.name | test("sops-.*.x86_64.rpm$")) | .browser_download_url')" && \
|
||||||
curl -sL https://talos.dev/install | sh && \
|
curl -sL https://talos.dev/install | sh && \
|
||||||
curl -s https://fluxcd.io/install.sh | bash
|
curl -s https://fluxcd.io/install.sh | bash
|
||||||
|
|
||||||
|
|||||||
9
containers/php/Containerfile
Normal file
9
containers/php/Containerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
ARG TAG
|
||||||
|
FROM job79/fedora:${TAG}
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
||||||
|
dnf -y --setopt=keepcache=1 install php composer && \
|
||||||
|
composer global require laravel/installer
|
||||||
|
|
||||||
|
USER user
|
||||||
2
containers/php/config.sh
Normal file
2
containers/php/config.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
arg "-v $HOME/Documents/php:/home/user/Documents/php"
|
||||||
Reference in New Issue
Block a user