forked from Job79/devcontainer
Compare commits
10 Commits
45aed1cf7a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
03df535d76
|
|||
|
d6ef16cd24
|
|||
|
a0ea04d2bd
|
|||
|
d7468a444b
|
|||
|
f25b6966ef
|
|||
|
9f1b65b781
|
|||
|
d81fa7d3a1
|
|||
|
7e27784a9a
|
|||
|
b5dd280e5a
|
|||
|
bb43c758f9
|
@@ -58,3 +58,12 @@ jobs:
|
|||||||
tags: git.plabble.org/job79/infra:${{ github.ref_name }}
|
tags: git.plabble.org/job79/infra:${{ github.ref_name }}
|
||||||
build-args: TAG=${{ github.ref_name }}
|
build-args: TAG=${{ github.ref_name }}
|
||||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||||
|
- name: Build and push vms container
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ./containers/vms
|
||||||
|
file: ./containers/vms/Containerfile
|
||||||
|
push: true
|
||||||
|
tags: git.plabble.org/job79/vms:${{ 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,5 +1,7 @@
|
|||||||
ARG TAG
|
ARG TAG
|
||||||
FROM git.plabble.org/job79/fedora:${TAG}
|
FROM git.plabble.org/job79/fedora:${TAG}
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN dnf -y install go
|
RUN dnf -y install go
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
arg "-v $HOME/Documents/containers/go:/home/user/projects"
|
arg "-v $HOME/Documents/go:/home/user/Documents/go"
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
ARG TAG
|
ARG TAG
|
||||||
FROM git.plabble.org/job79/fedora:${TAG}
|
FROM git.plabble.org/job79/fedora:${TAG}
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN dnf -y install kubectl openssl
|
RUN dnf -y install kubectl openssl
|
||||||
RUN curl -sL https://talos.dev/install | sh
|
RUN curl -sL https://talos.dev/install | sh
|
||||||
|
RUN curl -s https://fluxcd.io/install.sh | bash
|
||||||
|
|
||||||
USER user
|
USER user
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/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
|
|
||||||
7
containers/vms/Containerfile
Normal file
7
containers/vms/Containerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
ARG TAG
|
||||||
|
FROM git.plabble.org/job79/fedora:${TAG}
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN dnf -y install qemu-system-x86
|
||||||
|
|
||||||
|
USER user
|
||||||
6
containers/vms/config.sh
Normal file
6
containers/vms/config.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
arg "-v $HOME/Documents/vms:/home/user/Documents/vms"
|
||||||
|
arg "--net host"
|
||||||
|
arg "--device /dev/kvm"
|
||||||
|
arg "--device /dev/dri"
|
||||||
|
arg "--security-opt seccomp=unconfined"
|
||||||
9
devc.sh
9
devc.sh
@@ -49,6 +49,10 @@ param_args() {
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
-gpu) # Enable gpu acceleration.
|
-gpu) # Enable gpu acceleration.
|
||||||
arg "--device /dev/dri" ;;
|
arg "--device /dev/dri" ;;
|
||||||
|
-kvm) # Enable KVM.
|
||||||
|
arg "--device /dev/kvm" ;;
|
||||||
|
-usb) # Enable USB access.
|
||||||
|
arg "--device /dev/bus/usb" ;;
|
||||||
-host-spawn) # Enable spawning host commands from inside the container using host-spawn.
|
-host-spawn) # Enable spawning host commands from inside the container using host-spawn.
|
||||||
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.
|
||||||
@@ -59,6 +63,11 @@ param_args() {
|
|||||||
arg "-e DISPLAY=$DISPLAY"
|
arg "-e DISPLAY=$DISPLAY"
|
||||||
arg "-e XAUTHORITY=/run/user/1000/.Xauthority"
|
arg "-e XAUTHORITY=/run/user/1000/.Xauthority"
|
||||||
;;
|
;;
|
||||||
|
-mnt) # Mount directory.
|
||||||
|
shift
|
||||||
|
arg "-w /mnt/"
|
||||||
|
arg "-v $1:/mnt/$([ ! -d "$1" ] && echo 'file')"
|
||||||
|
;;
|
||||||
*) # Use unknown arguments a podman arguments.
|
*) # Use unknown arguments a podman arguments.
|
||||||
arg "$1" ;;
|
arg "$1" ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user