forked from Job79/devcontainer
Compare commits
10 Commits
45aed1cf7a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
03df535d76
|
|||
|
d6ef16cd24
|
|||
|
a0ea04d2bd
|
|||
|
d7468a444b
|
|||
|
f25b6966ef
|
|||
|
9f1b65b781
|
|||
|
d81fa7d3a1
|
|||
|
7e27784a9a
|
|||
|
b5dd280e5a
|
|||
|
bb43c758f9
|
@@ -1,17 +1,22 @@
|
|||||||
name: Build container
|
name: Build container
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # This makes the workflow manually triggered
|
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- "containers/fedora/**"
|
- "containers/fedora/**"
|
||||||
- "containers/dotnet/**"
|
- "containers/go/**"
|
||||||
- "containers/rust/**"
|
- "containers/infra/**"
|
||||||
- "containers/php/**"
|
|
||||||
- ".gitea/workflows/fedora.yaml"
|
- ".gitea/workflows/fedora.yaml"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
|
paths:
|
||||||
|
- "containers/fedora/**"
|
||||||
|
- "containers/go/**"
|
||||||
|
- "containers/infra/**"
|
||||||
|
- ".gitea/workflows/fedora.yaml"
|
||||||
|
schedule:
|
||||||
|
- cron: "0 16 * * FRI"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fedora-build:
|
fedora-build:
|
||||||
runs-on: job-latest
|
runs-on: job-latest
|
||||||
@@ -26,43 +31,39 @@ 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/maurice/fedora:${{ github.ref_name }}
|
tags: git.plabble.org/job79/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
|
|
||||||
# with:
|
|
||||||
# context: ./containers/rust
|
|
||||||
# file: ./containers/rust/Containerfile
|
|
||||||
# push: true
|
|
||||||
# tags: git.plabble.org/maurice/rust:${{ 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 PHP container
|
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./containers/php
|
context: ./containers/go
|
||||||
file: ./containers/php/Containerfile
|
file: ./containers/go/Containerfile
|
||||||
push: true
|
push: true
|
||||||
tags: git.plabble.org/maurice/php:${{ github.ref_name }}
|
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
|
||||||
|
- 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 }}
|
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 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 }}
|
|
||||||
# outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
name: Build optional dev containers
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # This makes the workflow manually triggered
|
|
||||||
|
|
||||||
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 Rider container
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./containers/rider
|
|
||||||
file: ./containers/rider/Containerfile
|
|
||||||
push: true
|
|
||||||
tags: git.plabble.org/maurice/rider:${{ 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 Android Studio container
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./containers/android
|
|
||||||
file: ./containers/android/Containerfile
|
|
||||||
push: true
|
|
||||||
tags: git.plabble.org/maurice/android:${{ 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 Flutter container
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./containers/flutter
|
|
||||||
file: ./containers/flutter/Containerfile
|
|
||||||
push: true
|
|
||||||
tags: git.plabble.org/maurice/flutter:${{ github.ref_name }}
|
|
||||||
build-args: TAG=${{ github.ref_name }}
|
|
||||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM git.plabble.org/maurice/dotnet:main
|
|
||||||
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"
|
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN dnf -y install libXext libXrender libXtst libX11 freetype freetype-devel mesa-libGLU
|
|
||||||
USER user
|
|
||||||
|
|
||||||
RUN curl -Lo /tmp/studio.tar.gz "${download_uri}" && \
|
|
||||||
mkdir /home/user/AndroidStudio && \
|
|
||||||
mkdir /home/user/Android && \
|
|
||||||
tar -zxf /tmp/studio.tar.gz -C /home/user/AndroidStudio && \
|
|
||||||
rm /tmp/studio.tar.gz && \
|
|
||||||
mv /home/user/AndroidStudio/android-studio*/* /home/user/AndroidStudio
|
|
||||||
|
|
||||||
RUN echo 'alias studio="$HOME/AndroidStudio/bin/studio"' >> /home/user/.bashrc
|
|
||||||
RUN echo 'export ANDROID_HOME="$HOME/Android/Sdk"' >> /home/user/.bashrc
|
|
||||||
RUN echo 'export PATH="$ANDROID_HOME/platform-tools:$PATH"' >> /home/user/.bashrc
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
FROM git.plabble.org/maurice/fedora:main
|
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN dnf -y install dotnet-sdk-9.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
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
version="v1.39.15-beta.60"
|
|
||||||
arch="linux-x64"
|
|
||||||
link="https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$version/omnisharp-$arch-net6.0.tar.gz"
|
|
||||||
|
|
||||||
curl -Lo /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,27 +5,20 @@ 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 \
|
||||||
git pnpm helix zip
|
zoxide git npm neovim awk jq unzip fd-find lazygit
|
||||||
|
|
||||||
# === setup user ===
|
# === setup user ===
|
||||||
RUN useradd -ms /bin/bash user && \
|
RUN useradd -ms /bin/bash user && \
|
||||||
usermod -aG wheel user && sed -i '/NOPASSWD/s/^#//g' /etc/sudoers && \
|
usermod -aG wheel user && sed -i '/NOPASSWD/s/^#//g' /etc/sudoers && \
|
||||||
mkdir -p /run/user/1000 && chown user:user /run/user/1000
|
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
|
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 --chown=user:user config/helix/ .config/helix/
|
|
||||||
COPY config/bin /usr/local/bin
|
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
|
VOLUME /home/user
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
arg "-p 8080:8080"
|
|
||||||
@@ -1,22 +1,16 @@
|
|||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
|
|
||||||
# === environment ===
|
# === environment ===
|
||||||
export EDITOR=hx \
|
export EDITOR=nvim \
|
||||||
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 \
|
||||||
PS1="\[\e[30;46m\] \h | \w \[\e[0;36m\]\[\e[m\] " \
|
PS1="\[\e[30;46m\] \h | \w \[\e[0;36m\]\[\e[m\] " \
|
||||||
TZ="Europe/Amsterdam" \
|
TZ="Europe/Amsterdam"
|
||||||
SHELL="/bin/bash"
|
|
||||||
|
|
||||||
# === aliases and functions ===
|
# === aliases and functions ===
|
||||||
pbcopy() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
alias vi=nvim
|
||||||
alias random="cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-20} | head -n 1"
|
post() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
||||||
|
|
||||||
# Git aliases
|
eval "$(zoxide init --cmd cd bash)"
|
||||||
alias gc="git commit -m"
|
eval "$(fzf --bash)"
|
||||||
alias ga="git add -A"
|
|
||||||
alias gf="git fetch"
|
|
||||||
alias gp="git pull"
|
|
||||||
alias gpp="git push"
|
|
||||||
alias gs="git status"
|
|
||||||
|
|||||||
1
containers/fedora/config/bin/podman
Symbolic link
1
containers/fedora/config/bin/podman
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
host
|
||||||
1
containers/fedora/config/bin/xdg-open
Symbolic link
1
containers/fedora/config/bin/xdg-open
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
host
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
[user]
|
[user]
|
||||||
email = maurict@pm.me
|
email = job@plabble.org
|
||||||
name = Maurice
|
name = Job79
|
||||||
signingKey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGL/am4HDyfV0OWwaI3CeKGypBdzNXOYSbcnm6tK/VB+ maurict@pm.me
|
signingKey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPsqM6ABAaCTQZ+llFXD3CXrYYuIHDEnvz8IBbXddYEc job@plabble.org
|
||||||
[gpg]
|
[gpg]
|
||||||
format = ssh
|
format = ssh
|
||||||
[commit]
|
[commit]
|
||||||
@@ -9,4 +9,4 @@
|
|||||||
[push]
|
[push]
|
||||||
autoSetupRemote = true
|
autoSetupRemote = true
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
theme = "dark_plus"
|
|
||||||
|
|
||||||
[editor]
|
|
||||||
true-color = true
|
|
||||||
|
|
||||||
[editor.file-picker]
|
|
||||||
hidden = false
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# C#
|
|
||||||
[language-server.omnisharp]
|
|
||||||
command = "/home/user/.omnisharp/OmniSharp"
|
|
||||||
args = [ "--languageserver" ]
|
|
||||||
|
|
||||||
# Rust
|
|
||||||
[language-server.rust-analyzer.config.check]
|
|
||||||
command = "clippy"
|
|
||||||
|
|
||||||
[[language]]
|
|
||||||
name = "rust"
|
|
||||||
formatter = { command = "rustfmt" }
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
FROM git.plabble.org/maurice/android:main
|
|
||||||
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"
|
|
||||||
|
|
||||||
RUN mkdir /home/user/Flutter && \
|
|
||||||
curl -Lo /tmp/flutter.tar.xz "${download_uri}" && \
|
|
||||||
tar -xf /tmp/flutter.tar.xz -C /home/user/Flutter && \
|
|
||||||
rm /tmp/flutter.tar.xz
|
|
||||||
|
|
||||||
RUN echo 'export PATH="$HOME/Flutter/flutter/bin:$PATH"' >> /home/user/.bashrc
|
|
||||||
RUN echo 'export FLUTTER_ROOT="$HOME/Flutter/flutter"' >> /home/user/.bashrc
|
|
||||||
7
containers/go/Containerfile
Normal file
7
containers/go/Containerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
ARG TAG
|
||||||
|
FROM git.plabble.org/job79/fedora:${TAG}
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN dnf -y install go
|
||||||
|
|
||||||
|
USER user
|
||||||
2
containers/go/config.sh
Normal file
2
containers/go/config.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
arg "-v $HOME/Documents/go:/home/user/Documents/go"
|
||||||
9
containers/infra/Containerfile
Normal file
9
containers/infra/Containerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
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
|
||||||
|
RUN curl -s https://fluxcd.io/install.sh | bash
|
||||||
|
|
||||||
|
USER user
|
||||||
2
containers/infra/config.sh
Normal file
2
containers/infra/config.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
arg "-v $HOME/Documents/infra:/home/user/Documents/infra"
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM git.plabble.org/maurice/fedora:main
|
|
||||||
ARG php_version="8.4"
|
|
||||||
|
|
||||||
RUN /bin/bash -c "export TERM=xterm && $(curl -fsSL https://php.new/install/linux/${php_version})"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
arg "--cap-add=NET_BIND_SERVICE -p 80:80"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
FROM git.plabble.org/maurice/dotnet:main
|
|
||||||
ARG rider_version="2025.2.4"
|
|
||||||
ARG download_uri="https://download.jetbrains.com/rider/JetBrains.Rider-${rider_version}.tar.gz"
|
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN dnf -y install libXext libXrender libXtst libX11 freetype freetype-devel
|
|
||||||
USER user
|
|
||||||
|
|
||||||
RUN curl -Lo /tmp/rider.tar.gz "${download_uri}" && \
|
|
||||||
mkdir /home/user/Rider && \
|
|
||||||
tar -zxf /tmp/rider.tar.gz -C /home/user/Rider && \
|
|
||||||
rm /tmp/rider.tar.gz && \
|
|
||||||
mv /home/user/Rider/JetBrains*/* /home/user/Rider
|
|
||||||
|
|
||||||
RUN echo 'alias rider="$HOME/Rider/bin/rider"' >> /home/user/.bashrc
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
arg "-p 8080:8080"
|
|
||||||
arg "-p 8081:8081"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
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
|
|
||||||
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"
|
||||||
23
devc.sh
23
devc.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# =============================================== #
|
# =============================================== #
|
||||||
# devc.sh v2.0; job79, maurice #
|
# devc.sh v2.0; job79 #
|
||||||
# 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. #
|
||||||
@@ -49,31 +49,25 @@ 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
|
-kvm) # Enable KVM.
|
||||||
arg "--device /dev/kvm" ;;
|
arg "--device /dev/kvm" ;;
|
||||||
-usb) # Enable USB access
|
-usb) # Enable USB access.
|
||||||
arg "--device /dev/bus/usb" ;;
|
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.
|
||||||
;;
|
;;
|
||||||
-net) # Enable network dev-<container name>
|
|
||||||
arg "--network dev-$name"
|
|
||||||
;;
|
|
||||||
-mnt) # Mount directory.
|
|
||||||
shift
|
|
||||||
arg "-w /workdir/"
|
|
||||||
arg "-v $1:/workdir/$([ ! -d "$1" ] && echo $1)"
|
|
||||||
;;
|
|
||||||
-mdf) # Mount dev folder
|
|
||||||
arg "-v $HOME/dev:/home/user/dev"
|
|
||||||
;;
|
|
||||||
-x11) # Enable X11 support.
|
-x11) # Enable X11 support.
|
||||||
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
||||||
arg "-v $XAUTHORITY:/run/user/1000/.Xauthority:ro"
|
arg "-v $XAUTHORITY:/run/user/1000/.Xauthority:ro"
|
||||||
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
|
||||||
@@ -116,7 +110,6 @@ fi
|
|||||||
# recreate it.
|
# recreate it.
|
||||||
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 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
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
# Tools
|
|
||||||
pbcopy() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
|
||||||
alias code="flatpak run com.visualstudio.code"
|
|
||||||
alias random="cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-20} | head -n 1"
|
|
||||||
|
|
||||||
# Dev containers
|
|
||||||
export DEVC_REGISTRY="git.plabble.org/maurice"
|
|
||||||
|
|
||||||
function devc() {
|
|
||||||
"$HOME/dev/devcontainer/devc.sh" "$@" -mdf
|
|
||||||
}
|
|
||||||
|
|
||||||
alias rider="DEVC_COMMAND=/home/user/Rider/bin/rider devc rider -x11 -host-spawn -net"
|
|
||||||
alias flutter="devc flutter -x11 -host-spawn -kvm -usb -gpu"
|
|
||||||
alias androidstudio="DEVC_COMMAND=/home/user/AndroidStudio/bin/studio devc android -x11 -host-spawn -kvm -usb -gpu"
|
|
||||||
|
|
||||||
function hx() {
|
|
||||||
arg="${1:-.}"
|
|
||||||
DEVC_COMMAND="hx $arg" devc fedora -mnt $arg
|
|
||||||
}
|
|
||||||
|
|
||||||
# Git aliases
|
|
||||||
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"
|
|
||||||
Reference in New Issue
Block a user