Some checks failed
Reese's Arch Toolbox / build-and-push-arch-toolbox (push) Failing after 16s
161 lines
4.1 KiB
Markdown
161 lines
4.1 KiB
Markdown
# Toolbox
|
|
|
|
- [Toolbox](#toolbox)
|
|
- [Reese's Arch Toolbox](#reeses-arch-toolbox)
|
|
- [Using Reese's Arch Toolbox](#using-reeses-arch-toolbox)
|
|
- [CPU Image](#cpu-image)
|
|
- [AMD GPU Image](#amd-gpu-image)
|
|
- [Updating Reese's Arch Toolbox](#updating-reeses-arch-toolbox)
|
|
- [Building Reese's Arch Toolbox](#building-reeses-arch-toolbox)
|
|
|
|
```bash
|
|
# Create and use an Arch Toolbox
|
|
toolbox create --distro arch
|
|
toolbox enter arch-toolbox-latest
|
|
```
|
|
|
|
I'd recommend adding this alias to your `.bashrc` to make things easier
|
|
|
|
```bash
|
|
# Toolbox quick enter
|
|
alias tbox='SHELL=zsh toolbox enter arch-toolbox-latest'
|
|
```
|
|
|
|
## Reese's Arch Toolbox
|
|
|
|
I have a custom arch image based on the default arch-toolbox image. It offers:
|
|
|
|
- zsh with many completions installed/enabled
|
|
- vim
|
|
- nslookup
|
|
- iperf3
|
|
- kubectl
|
|
- helm
|
|
- nethogs
|
|
- python, pip, and pipx
|
|
- ansible
|
|
- aws cli
|
|
- podman (connected automatically to the host machine via the unix socket)
|
|
- tmux
|
|
- ffmpeg
|
|
- wine
|
|
- podman
|
|
- unzip
|
|
- bat
|
|
- btop
|
|
- jq
|
|
- yq
|
|
- imagemagick
|
|
|
|
## Using Reese's Arch Toolbox
|
|
|
|
Copy the relevant aliases below into your `.bashrc`.
|
|
|
|
Run `ntbox` the first time to create a new toolbox.
|
|
|
|
Run `tbox` anytime you want to enter the toolbox.
|
|
|
|
Run `rtbox` to delete the toolbox.
|
|
|
|
Run `utbox` to update the toolbox image. You'll need to run `rtbox && ntbox` after to spin up the toolbox with the new image.
|
|
|
|
### CPU Image
|
|
|
|
Add the following to your `.bashrc`
|
|
|
|
```bash
|
|
# Reese's Toolbox Commands
|
|
export TBOX_REPO='gitea.reeseapps.com/services'
|
|
export TBOX_IMAGE='arch-toolbox'
|
|
export TBOX_TAG='latest'
|
|
export TBOX_NAME="$TBOX_IMAGE-$TBOX_TAG"
|
|
# Creates a new toolbox
|
|
alias ntbox="toolbox create -i $TBOX_REPO/$TBOX_IMAGE:$TBOX_TAG"
|
|
# Enters the toolbox when you want to use it, you'll be running this all the time
|
|
alias tbox="SHELL=/bin/zsh toolbox enter $TBOX_NAME"
|
|
# Removes the toolbox
|
|
alias rtbox="podman container stop $TBOX_NAME && podman container rm $TBOX_NAME"
|
|
# Updates the toolbox
|
|
alias utbox="podman pull $TBOX_REPO/$TBOX_IMAGE:$TBOX_TAG"
|
|
```
|
|
|
|
### AMD GPU Image
|
|
|
|
Add the following to your `.bashrc`
|
|
|
|
```bash
|
|
# Reese's Toolbox Commands
|
|
export TBOX_REPO='gitea.reeseapps.com/services'
|
|
export TBOX_IMAGE='arch-toolbox-amdgpu'
|
|
export TBOX_TAG='latest'
|
|
export TBOX_NAME="$TBOX_IMAGE-$TBOX_TAG"
|
|
# Creates a new toolbox
|
|
alias ntbox="toolbox create -i $TBOX_REPO/$TBOX_IMAGE:$TBOX_TAG"
|
|
# Enters the toolbox when you want to use it, you'll be running this all the time
|
|
alias tbox="SHELL=/bin/zsh toolbox enter $TBOX_NAME"
|
|
# Removes the toolbox
|
|
alias rtbox="podman container stop $TBOX_NAME && podman container rm $TBOX_NAME"
|
|
# Updates the toolbox
|
|
alias utbox="podman pull $TBOX_REPO/$TBOX_IMAGE:$TBOX_TAG"
|
|
```
|
|
|
|
## Updating Reese's Arch Toolbox
|
|
|
|
```bash
|
|
# Stop the current arch toolbox
|
|
untbox
|
|
|
|
# Pull the newest image
|
|
podman pull gitea.reeseapps.com/services/arch-toolbox:latest
|
|
# Start with the new image
|
|
toolbox create -i gitea.reeseapps.com/services/arch-toolbox:latest
|
|
```
|
|
|
|
## Building Reese's Arch Toolbox
|
|
|
|
You can build and run the image wit this (See `Containerfile` in this directory):
|
|
|
|
```bash
|
|
# Build latest image
|
|
podman build \
|
|
--no-cache \
|
|
-t gitea.reeseapps.com/services/arch-toolbox:latest \
|
|
-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
|
|
```
|
|
|
|
In vscode you can set this as your default build task for homelab and trigger it with
|
|
`ctrl shift B`
|
|
|
|
.vscode/tasks.json
|
|
|
|
```json
|
|
{
|
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
// for the documentation about the tasks.json format
|
|
"version": "2.0.0",
|
|
"tasks": [
|
|
{
|
|
"label": "Build arch-toolbox",
|
|
"type": "shell",
|
|
"command": "./infrastructure/graduated/fedora/arch-build.sh",
|
|
"problemMatcher": [],
|
|
"group": {
|
|
"kind": "build",
|
|
"isDefault": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
```
|