add podman, various tools, etc. to arch toolbox

This commit is contained in:
2024-11-25 20:00:09 -05:00
parent 5f1d03349b
commit b68e22af56
3 changed files with 117 additions and 55 deletions

View File

@@ -3,8 +3,39 @@ FROM quay.io/toolbx/arch-toolbox:latest
RUN pacman -Syu --noconfirm RUN pacman -Syu --noconfirm
# Install zsh # 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 <<EOF /etc/zsh/zshrc.local COPY <<EOF /etc/zsh/zshrc.local
# Basic settings # Basic settings
autoload bashcompinit && bashcompinit autoload bashcompinit && bashcompinit
@@ -24,18 +55,13 @@ source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/doc/pkgfile/command-not-found.zsh source /usr/share/doc/pkgfile/command-not-found.zsh
### Custom Commands and Aliases ### ### Custom Commands and Aliases ###
# Fix for Ansible
export LC_ALL="C.UTF-8"
# AWS
complete -C '/usr/local/bin/aws_completer' aws
# Podman
export CONTAINER_HOST=unix:///run/user/1000/podman/podman.sock
EOF EOF
# Install tools
RUN pacman -S --noconfirm \
vim \
bind \
iperf3 \
kubectl \
helm \
nethogs \
python \
python-pip \
python-pipx
CMD /usr/bin/zsh

View File

@@ -0,0 +1,12 @@
# 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
# 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

View File

@@ -1,6 +1,7 @@
# Fedora Kinoite # Fedora Kinoite
- [Fedora Kinoite](#fedora-kinoite) - [Fedora Kinoite](#fedora-kinoite)
- [Podman](#podman)
- [Apps](#apps) - [Apps](#apps)
- [VSCode](#vscode) - [VSCode](#vscode)
- [Bitwarden](#bitwarden) - [Bitwarden](#bitwarden)
@@ -16,10 +17,25 @@
- [Marknote](#marknote) - [Marknote](#marknote)
- [Raspberry Pi Imager](#raspberry-pi-imager) - [Raspberry Pi Imager](#raspberry-pi-imager)
- [Fedora Media Writer](#fedora-media-writer) - [Fedora Media Writer](#fedora-media-writer)
- [Pods](#pods)
- [Toolbox](#toolbox) - [Toolbox](#toolbox)
- [Arch Toolbox Setup](#arch-toolbox-setup)
- [Custom image](#custom-image) - [Custom image](#custom-image)
## Podman
Since you'll be using podman for most container-based services, you'll want to set the
the podman auth file to somewhere persistent, otherwise it'll get deleted every time you
reboot.
Add this to your `.bashrc`:
```bash
# Podman auth file
export REGISTRY_AUTH_FILE=$HOME/.podman-auth.json
```
Source that and then run `podman login` to create the file.
## Apps ## Apps
Flatpak installs are from Flathub unless otherwise noted. Flatpak installs are from Flathub unless otherwise noted.
@@ -156,53 +172,61 @@ Flash your stick.
flatpak install org.fedoraproject.MediaWriter flatpak install org.fedoraproject.MediaWriter
``` ```
### Pods
Remember Docker Desktop? Pods is the new Docker Desktop.
```bash
flatpak install com.github.marhkb.Pods
```
## Toolbox ## Toolbox
```bash ```bash
# Create and use an Arch Toolbox
toolbox create --distro arch toolbox create --distro arch
toolbox enter arch-toolbox-latest toolbox enter arch-toolbox-latest
``` ```
### Arch Toolbox Setup
Install zsh
```bash
pacman -S zsh grml-zsh-config zsh-syntax-highlighting zsh-autosuggestions pkgfile
cat <<EOF > ~/.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 ### 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 ```bash
podman build -t gitea.reeseapps.com/arch-toolbox:latest -f ./infrastructure/graduated/fedora/Containerfile toolbox create -i gitea.reeseapps.com/services/arch-toolbox:latest
toolbox create -i gitea.reeseapps.com/arch-toolbox:latest SHELL=/bin/zsh toolbox enter arch-toolbox-latest
toolbox enter ```
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 {}
``` ```