feat: build multiple image
This commit is contained in:
20
containers/base/Containerfile
Normal file
20
containers/base/Containerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM quay.io/fedora/fedora:42
|
||||
|
||||
# === install system packages ===
|
||||
RUN dnf update -y && \
|
||||
dnf copr enable -y atim/lazygit && \
|
||||
dnf -y install procps ping bash-completion glibc-langpack-en \
|
||||
host-spawn dbus-launch \
|
||||
zoxide git npm neovim awk jq unzip fd-find chafa 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
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
RUN mkdir .config .local .cache
|
||||
COPY --chown=user:user config/bashrc .bashrc
|
||||
COPY config/bin /usr/local/bin
|
||||
VOLUME /home/user
|
||||
21
containers/base/config/bashrc
Normal file
21
containers/base/config/bashrc
Normal file
@@ -0,0 +1,21 @@
|
||||
. /etc/bashrc
|
||||
|
||||
# === container enter logic - cd to ENTER_DIR ===
|
||||
ENTER_DIR="${ENTER_DIR/#\~/$HOME}"
|
||||
[ -d "$ENTER_DIR" ] && cd "$ENTER_DIR"
|
||||
|
||||
# === environment ===
|
||||
export EDITOR=nvim \
|
||||
WAYLAND_DISPLAY=wayland-0 \
|
||||
XDG_RUNTIME_DIR=/run/user/1000 \
|
||||
SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock \
|
||||
DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/bus" \
|
||||
PS1="\[\e[30;46m\] $CONTAINER_NAME | \w \[\e[0;36m\]\[\e[m\] " \
|
||||
TZ="Europe/Amsterdam"
|
||||
|
||||
# === aliases and functions ===
|
||||
alias vi=nvim
|
||||
post() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
||||
|
||||
eval "$(zoxide init --cmd cd bash)"
|
||||
eval "$(fzf --bash)"
|
||||
2
containers/base/config/bin/host
Executable file
2
containers/base/config/bin/host
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
host-spawn -cwd "${PWD/#$HOME/$HOST_HOME}" $(basename "$0") "$@"
|
||||
1
containers/base/config/bin/podman
Symbolic link
1
containers/base/config/bin/podman
Symbolic link
@@ -0,0 +1 @@
|
||||
host
|
||||
1
containers/base/config/bin/xdg-open
Symbolic link
1
containers/base/config/bin/xdg-open
Symbolic link
@@ -0,0 +1 @@
|
||||
host
|
||||
4
containers/go/Containerfile
Normal file
4
containers/go/Containerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM ghcr.io/job79/base:latest
|
||||
USER root
|
||||
RUN dnf -y install go
|
||||
USER user
|
||||
3
containers/go/config.sh
Normal file
3
containers/go/config.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
for dir in "Code" "Documents" "Downloads" ".config/devcontainer"; do
|
||||
arg "-v $HOME/$dir:/home/user/$dir"
|
||||
done
|
||||
4
containers/kube/Containerfile
Normal file
4
containers/kube/Containerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM ghcr.io/job79/base:latest
|
||||
USER root
|
||||
RUN dnf -y install kubectl
|
||||
USER user
|
||||
3
containers/kube/config.sh
Normal file
3
containers/kube/config.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
for dir in "Code" "Documents" "Downloads" ".config/devcontainer"; do
|
||||
arg "-v $HOME/$dir:/home/user/$dir"
|
||||
done
|
||||
Reference in New Issue
Block a user