forked from Job79/devcontainer
Tweaks
This commit is contained in:
@@ -4,18 +4,10 @@ on:
|
|||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- "containers/fedora/**"
|
- "containers/fedora/**"
|
||||||
- "containers/go/**"
|
- "containers/dotnet/**"
|
||||||
- "containers/infra/**"
|
- "containers/rust/**"
|
||||||
|
- "containers/php/**"
|
||||||
- ".gitea/workflows/fedora.yaml"
|
- ".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:
|
jobs:
|
||||||
fedora-build:
|
fedora-build:
|
||||||
@@ -31,30 +23,43 @@ jobs:
|
|||||||
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 and push fedora container
|
|
||||||
|
- name: Build and push Fedora container
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./containers/fedora
|
context: ./containers/fedora
|
||||||
file: ./containers/fedora/Containerfile
|
file: ./containers/fedora/Containerfile
|
||||||
push: true
|
push: true
|
||||||
tags: git.plabble.org/job79/fedora:${{ github.ref_name }}
|
tags: git.plabble.org/maurice/fedora:${{ 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 go container
|
|
||||||
|
- name: Build and push Rust container
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./containers/go
|
context: ./containers/rust
|
||||||
file: ./containers/go/Containerfile
|
file: ./containers/rust/Containerfile
|
||||||
push: true
|
push: true
|
||||||
tags: git.plabble.org/job79/go:${{ github.ref_name }}
|
tags: git.plabble.org/maurice/rust:${{ 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 infra container
|
|
||||||
|
- name: Build and push PHP container
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./containers/infra
|
context: ./containers/php
|
||||||
file: ./containers/infra/Containerfile
|
file: ./containers/php/Containerfile
|
||||||
push: true
|
push: true
|
||||||
tags: git.plabble.org/job79/infra:${{ github.ref_name }}
|
tags: git.plabble.org/maurice/php:${{ 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 C# container
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ./containers/dotnet
|
||||||
|
file: ./containers/dotnet/Containerfile
|
||||||
|
push: true
|
||||||
|
tags: git.plabble.org/maurice/dotnet:${{ 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
|
||||||
|
|||||||
@@ -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
|
|
||||||
9
containers/dotnet/Containerfile
Normal file
9
containers/dotnet/Containerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM git.plabble.org/maurice/devc-base:main
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN dnf -y install dotnet-sdk-9.0
|
||||||
|
|
||||||
|
COPY scripts/install-roslyn.sh /tmp/install-roslyn.sh
|
||||||
|
RUN chmod +x /tmp/install-roslyn.sh && /tmp/install-roslyn.sh
|
||||||
|
|
||||||
|
USER user
|
||||||
9
containers/dotnet/install-roslyn.sh
Normal file
9
containers/dotnet/install-roslyn.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
version="v1.39.15-beta.60"
|
||||||
|
arch="linux-musl-x64"
|
||||||
|
link="https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$version/omnisharp-$arch-net6.0.tar.gz"
|
||||||
|
|
||||||
|
wget -O /tmp/omnisharp.tar.gz $link
|
||||||
|
mkdir /home/user/.omnisharp
|
||||||
|
tar -zxf /tmp/omnisharp.tar.gz -C /home/user/.omnisharp/
|
||||||
|
chown -R user:user /home/user/.omnisharp
|
||||||
@@ -5,7 +5,7 @@ RUN 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 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
|
git pnpm helix
|
||||||
|
|
||||||
# === setup user ===
|
# === setup user ===
|
||||||
RUN useradd -ms /bin/bash user && \
|
RUN useradd -ms /bin/bash user && \
|
||||||
@@ -16,9 +16,15 @@ USER user
|
|||||||
WORKDIR /home/user
|
WORKDIR /home/user
|
||||||
RUN mkdir .config .local .cache
|
RUN mkdir .config .local .cache
|
||||||
|
|
||||||
RUN git clone https://git.plabble.org/Job79/neovim-config.git .config/nvim
|
|
||||||
COPY --chown=user:user config/bashrc .bashrc
|
COPY --chown=user:user config/bashrc .bashrc
|
||||||
COPY --chown=user:user config/git .config/git/config
|
COPY --chown=user:user config/git .config/git/config
|
||||||
COPY config/bin /usr/local/bin
|
COPY config/bin /usr/local/bin
|
||||||
|
|
||||||
|
# === Add host entry for podman ===
|
||||||
|
RUN ln -s /usr/local/bin/host /usr/local/bin/podman
|
||||||
|
|
||||||
|
# === Setup PNPM & install language servers ===
|
||||||
|
RUN /bin/bash -c "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
|
VOLUME /home/user
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
|
|
||||||
# === environment ===
|
# === environment ===
|
||||||
export EDITOR=nvim \
|
export EDITOR=hx \
|
||||||
WAYLAND_DISPLAY=wayland-0 \
|
WAYLAND_DISPLAY=wayland-0 \
|
||||||
XDG_RUNTIME_DIR=/run/user/1000 \
|
XDG_RUNTIME_DIR=/run/user/1000 \
|
||||||
SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock \
|
SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock \
|
||||||
@@ -9,8 +9,13 @@ export EDITOR=nvim \
|
|||||||
TZ="Europe/Amsterdam"
|
TZ="Europe/Amsterdam"
|
||||||
|
|
||||||
# === aliases and functions ===
|
# === aliases and functions ===
|
||||||
alias vi=nvim
|
pbcopy() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
||||||
post() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
alias random="cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-20} | head -n 1"
|
||||||
|
|
||||||
eval "$(zoxide init --cmd cd bash)"
|
# Git aliases
|
||||||
eval "$(fzf --bash)"
|
alias gc="git commit -m"
|
||||||
|
alias ga="git add -A"
|
||||||
|
alias gf="git fetch"
|
||||||
|
alias gp="git pull"
|
||||||
|
alias gpp="git push"
|
||||||
|
alias gs="git status"
|
||||||
@@ -1 +0,0 @@
|
|||||||
host
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
host
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
[user]
|
[user]
|
||||||
email = job@plabble.org
|
email = maurict@pm.me
|
||||||
name = Job79
|
name = Maurice
|
||||||
signingKey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPsqM6ABAaCTQZ+llFXD3CXrYYuIHDEnvz8IBbXddYEc job@plabble.org
|
signingKey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGL/am4HDyfV0OWwaI3CeKGypBdzNXOYSbcnm6tK/VB+ maurict@pm.me
|
||||||
[gpg]
|
[gpg]
|
||||||
format = ssh
|
format = ssh
|
||||||
[commit]
|
[commit]
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
ARG TAG
|
|
||||||
FROM git.plabble.org/job79/fedora:${TAG}
|
|
||||||
USER root
|
|
||||||
RUN dnf -y install go
|
|
||||||
USER user
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
arg "-v $HOME/Documents/containers/go:/home/user/projects"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
ARG TAG
|
|
||||||
FROM git.plabble.org/job79/fedora:${TAG}
|
|
||||||
USER root
|
|
||||||
RUN dnf -y install kubectl openssl
|
|
||||||
RUN curl -sL https://talos.dev/install | sh
|
|
||||||
USER user
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
arg "-v $HOME/Documents/containers/infra:/home/user/projects"
|
|
||||||
@@ -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
|
|
||||||
3
containers/php/Containerfile
Normal file
3
containers/php/Containerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
FROM git.plabble.org/maurice/devc-base:main
|
||||||
|
|
||||||
|
RUN /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)"
|
||||||
4
containers/rust/Containerfile
Normal file
4
containers/rust/Containerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FROM git.plabble.org/maurice/devc-base: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
|
||||||
5
devc.sh
5
devc.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# =============================================== #
|
# =============================================== #
|
||||||
# devc.sh v2.0; job79 #
|
# devc.sh v2.0; job79, maurice #
|
||||||
# Dev container enter script. Handles setting up #
|
# Dev container enter script. Handles setting up #
|
||||||
# different dev containers, resuming sessions and #
|
# different dev containers, resuming sessions and #
|
||||||
# automatic container updates. #
|
# automatic container updates. #
|
||||||
@@ -36,6 +36,9 @@ default_args() {
|
|||||||
# restarts. Use copy to keep the files from the image.
|
# restarts. Use copy to keep the files from the image.
|
||||||
arg "-v $name:/home/user:copy"
|
arg "-v $name:/home/user:copy"
|
||||||
|
|
||||||
|
# Mount dev folder
|
||||||
|
arg "-v $HOME/dev:/home/user/dev"
|
||||||
|
|
||||||
# If there is custom configuration for the container, load
|
# If there is custom configuration for the container, load
|
||||||
# it here.
|
# it here.
|
||||||
config_file="$(dirname "$(realpath "$0")")/containers/$name/config.sh"
|
config_file="$(dirname "$(realpath "$0")")/containers/$name/config.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user