forked from Job79/devcontainer
Compare commits
25 Commits
f4e97c5d77
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
8f761565d0
|
|||
|
86e3275c67
|
|||
|
e6bd3f3524
|
|||
|
4e1737f5b3
|
|||
|
32bbe1c2cd
|
|||
|
678b8bee6e
|
|||
|
0d3d5d5b36
|
|||
|
8bde490c6d
|
|||
|
cdbb4de204
|
|||
|
9b81bc8c68
|
|||
|
40bb6328c4
|
|||
|
c137f16ddf
|
|||
|
057c72e3a0
|
|||
|
062972a440
|
|||
|
723d2fd984
|
|||
|
03df535d76
|
|||
|
d6ef16cd24
|
|||
|
a0ea04d2bd
|
|||
|
d7468a444b
|
|||
|
f25b6966ef
|
|||
|
9f1b65b781
|
|||
|
d81fa7d3a1
|
|||
|
7e27784a9a
|
|||
|
b5dd280e5a
|
|||
|
bb43c758f9
|
113
.gitea/workflows/build.yaml
Normal file
113
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,113 @@
|
||||
name: Build containers
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths: ["containers/**", ".gitea/workflows/build.yaml"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths: ["containers/**", ".gitea/workflows/build.yaml"]
|
||||
schedule:
|
||||
- cron: "0 16 * * FRI"
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: job-v2
|
||||
outputs:
|
||||
fedora: ${{ 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' }}
|
||||
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:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: https://github.com/dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
workflow: ['.gitea/workflows/build.yaml']
|
||||
fedora: ['containers/fedora/**']
|
||||
infra: ['containers/infra/**']
|
||||
go: ['containers/go/**']
|
||||
php: ['containers/php/**']
|
||||
|
||||
base-image:
|
||||
needs: [changes]
|
||||
if: ${{ needs.changes.outputs.fedora == 'true' || needs.changes.outputs.any_change == 'true' }}
|
||||
runs-on: job-v2
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Log in
|
||||
uses: redhat-actions/podman-login@v1
|
||||
with:
|
||||
registry: git.plabble.org
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
- name: Build
|
||||
id: build
|
||||
uses: job79/buildah-build@65b3793a1370c1ccd74a5c0d090d70eb9637a4ef
|
||||
with:
|
||||
image: job79/fedora
|
||||
tags: ${{ github.ref_name }}
|
||||
context: ./containers/fedora
|
||||
containerfiles: ./containers/fedora/Containerfile
|
||||
- name: Push
|
||||
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
|
||||
|
||||
dependent-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: [infra, go, php]
|
||||
steps:
|
||||
- name: Check if build needed
|
||||
id: check
|
||||
run: |
|
||||
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 }}" == "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
|
||||
- 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: job79/${{ 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
|
||||
@@ -1,60 +0,0 @@
|
||||
name: Build container
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "containers/fedora/**"
|
||||
- "containers/go/**"
|
||||
- "containers/infra/**"
|
||||
- ".gitea/workflows/fedora.yaml"
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "containers/fedora/**"
|
||||
- "containers/go/**"
|
||||
- "containers/infra/**"
|
||||
- ".gitea/workflows/fedora.yaml"
|
||||
schedule:
|
||||
- cron: "0 16 * * FRI"
|
||||
|
||||
jobs:
|
||||
fedora-build:
|
||||
runs-on: job-latest
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.plabble.org
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
- name: Build and push fedora container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/fedora
|
||||
file: ./containers/fedora/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/job79/fedora:${{ github.ref_name }}
|
||||
build-args: TAG=${{ github.ref_name }}
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
- name: Build and push go container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/go
|
||||
file: ./containers/go/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/job79/go:${{ github.ref_name }}
|
||||
build-args: TAG=${{ github.ref_name }}
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
- name: Build and push infra container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/infra
|
||||
file: ./containers/infra/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/job79/infra:${{ github.ref_name }}
|
||||
build-args: TAG=${{ github.ref_name }}
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
@@ -1,37 +0,0 @@
|
||||
name: Build container
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "containers/kali/**"
|
||||
- ".gitea/workflows/kali.yaml"
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "containers/kali/**"
|
||||
- ".gitea/workflows/kali.yaml"
|
||||
schedule:
|
||||
- cron: "0 16 * * FRI"
|
||||
|
||||
jobs:
|
||||
kali-build:
|
||||
runs-on: job-latest
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.plabble.org
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
- name: Build and push kali container
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./containers/kali
|
||||
file: ./containers/kali/Containerfile
|
||||
push: true
|
||||
tags: git.plabble.org/job79/kali:${{ github.ref_name }}
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
@@ -1,22 +1,21 @@
|
||||
FROM quay.io/fedora/fedora:43
|
||||
|
||||
# === 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 -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 \
|
||||
zoxide git npm neovim awk jq unzip fd-find lazygit
|
||||
|
||||
# === 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
|
||||
RUN useradd -ms /bin/bash user && echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers && mkdir -p /run/user/1000 && chown user:user /run/user/1000
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
RUN mkdir .config .local .cache
|
||||
|
||||
RUN git clone https://git.plabble.org/Job79/neovim-config.git .config/nvim
|
||||
RUN mkdir .config .local .cache && \
|
||||
git clone https://git.plabble.org/Job79/neovim-config.git .config/nvim
|
||||
COPY --chown=user:user config/bashrc .bashrc
|
||||
COPY --chown=user:user config/git .config/git/config
|
||||
COPY config/bin /usr/local/bin
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
ARG TAG
|
||||
FROM git.plabble.org/job79/fedora:${TAG}
|
||||
FROM job79/fedora:${TAG}
|
||||
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
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
arg "-v $HOME/Documents/containers/go:/home/user/projects"
|
||||
arg "-v $HOME/Documents/go:/home/user/Documents/go"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
ARG TAG
|
||||
FROM git.plabble.org/job79/fedora:${TAG}
|
||||
FROM job79/fedora:${TAG}
|
||||
USER root
|
||||
RUN dnf -y install kubectl openssl
|
||||
RUN curl -sL https://talos.dev/install | sh
|
||||
|
||||
RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \
|
||||
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 -s https://fluxcd.io/install.sh | bash
|
||||
|
||||
USER user
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
arg "-v $HOME/Documents/containers/infra:/home/user/projects"
|
||||
arg "-v $HOME/Documents/infra:/home/user/Documents/infra"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
FROM docker.io/kalilinux/kali-rolling
|
||||
|
||||
# === install system packages ===
|
||||
RUN apt update && \
|
||||
apt -y install iputils-ping sudo \
|
||||
zoxide git npm neovim gawk jq unzip fd-find lazygit
|
||||
|
||||
# === setup user ===
|
||||
RUN useradd -ms /bin/bash user && \
|
||||
usermod -aG sudo user && sed -i 's/^%sudo\s\+ALL=(ALL:ALL)\s\+ALL$/%sudo\tALL=(ALL:ALL)\tNOPASSWD: ALL/' /etc/sudoers && \
|
||||
mkdir -p /run/user/1000 && chown user:user /run/user/1000
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
RUN mkdir -p .config .local .cache
|
||||
RUN git clone https://git.plabble.org/Job79/neovim-config.git .config/nvim
|
||||
VOLUME /home/user
|
||||
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