From b68e22af568b275351e84078d503976995151cd5 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 25 Nov 2024 20:00:09 -0500 Subject: [PATCH] add podman, various tools, etc. to arch toolbox --- infrastructure/graduated/fedora/Containerfile | 56 +++++++--- infrastructure/graduated/fedora/arch-build.sh | 12 ++ .../graduated/fedora/fedora-kinoite.md | 104 +++++++++++------- 3 files changed, 117 insertions(+), 55 deletions(-) create mode 100755 infrastructure/graduated/fedora/arch-build.sh diff --git a/infrastructure/graduated/fedora/Containerfile b/infrastructure/graduated/fedora/Containerfile index 0166857..36cd117 100644 --- a/infrastructure/graduated/fedora/Containerfile +++ b/infrastructure/graduated/fedora/Containerfile @@ -3,8 +3,39 @@ FROM quay.io/toolbx/arch-toolbox:latest RUN pacman -Syu --noconfirm # Install zsh -RUN pacman -S --noconfirm zsh grml-zsh-config zsh-syntax-highlighting zsh-autosuggestions pkgfile +RUN pacman -S --noconfirm \ + zsh \ + grml-zsh-config \ + zsh-syntax-highlighting \ + zsh-autosuggestions \ + pkgfile +# Install tools +RUN pacman -S --noconfirm \ + vim \ + bind \ + iperf3 \ + kubectl \ + helm \ + nethogs \ + python \ + python-pip \ + python-pipx \ + ansible + +# Ollama +RUN curl -fsSL https://ollama.com/install.sh | sh + +# AWS CLI +RUN pacman -S --noconfirm unzip +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +RUN unzip awscliv2.zip +RUN ./aws/install + +# Podman +RUN pacman -S --noconfirm podman + +# ZSHRC COPY < ~/.zshrc -# Basic settings -autoload bashcompinit && bashcompinit -autoload -U compinit; compinit -zstyle ':completion:*' menu select - -# Prompt settings -autoload -Uz promptinit -promptinit -PROMPT_EOL_MARK= - -# Syntax Highlighting -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh - -# Command Not Found Autocomplete -source /usr/share/doc/pkgfile/command-not-found.zsh - -### Custom Commands and Aliases ### -EOF -``` - -Add this to your ~/.bashrc to launch zsh - -```bash -# If zsh exists, zsh -if [ -f /bin/zsh ]; then zsh && exit; fi -``` - ### Custom image +I have a custom arch image based on the default arch-toolbox image. It installs some +extras (python, vim, kubectl, etc.) and sets up zsh with a decent default zshrc. + +If you're just looking to run the image do this: + ```bash -podman build -t gitea.reeseapps.com/arch-toolbox:latest -f ./infrastructure/graduated/fedora/Containerfile -toolbox create -i gitea.reeseapps.com/arch-toolbox:latest -toolbox enter +toolbox create -i gitea.reeseapps.com/services/arch-toolbox:latest +SHELL=/bin/zsh toolbox enter arch-toolbox-latest +``` + +You can build and run the image wit this (See `Containerfile` in this directory): + +```bash +# Build latest image +podman build \ + -t gitea.reeseapps.com/services/arch-toolbox:latest \ + -t gitea.reeseapps.com/services/arch-toolbox:$(date +%s) \ + -f ./infrastructure/graduated/fedora/Containerfile + +# Test with podman +podman run -it --rm gitea.reeseapps.com/services/arch-toolbox:latest + +# Stop the current arch toolbox +podman container stop arch-toolbox-latest +# Remove the old container +podman container rm arch-toolbox-latest +# Start with the new image +toolbox create -i gitea.reeseapps.com/services/arch-toolbox:latest +SHELL=/bin/zsh toolbox enter +``` + +You can push the image up to your registry like normal: + +```bash +# Push all tags for the "latest" image +podman image ls \ + -f 'reference=gitea.reeseapps.com/services/arch-toolbox:latest' \ + -n --no-trunc --format '{{ .Repository }}:{{ .Tag }}' \ + | xargs -I {} podman push {} ```