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

@@ -1,6 +1,7 @@
# Fedora Kinoite
- [Fedora Kinoite](#fedora-kinoite)
- [Podman](#podman)
- [Apps](#apps)
- [VSCode](#vscode)
- [Bitwarden](#bitwarden)
@@ -16,10 +17,25 @@
- [Marknote](#marknote)
- [Raspberry Pi Imager](#raspberry-pi-imager)
- [Fedora Media Writer](#fedora-media-writer)
- [Pods](#pods)
- [Toolbox](#toolbox)
- [Arch Toolbox Setup](#arch-toolbox-setup)
- [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
Flatpak installs are from Flathub unless otherwise noted.
@@ -156,53 +172,61 @@ Flash your stick.
flatpak install org.fedoraproject.MediaWriter
```
### Pods
Remember Docker Desktop? Pods is the new Docker Desktop.
```bash
flatpak install com.github.marhkb.Pods
```
## Toolbox
```bash
# Create and use an Arch Toolbox
toolbox create --distro arch
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
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 {}
```