move arch distoolbox to its own folder
All checks were successful
Reese's Arch Toolbox / build-and-push-arch-toolbox (push) Successful in 38m2s

This commit is contained in:
2025-02-16 13:08:50 -05:00
parent d51b972e96
commit 2e4274a306
12 changed files with 93 additions and 94 deletions

View File

@@ -3,7 +3,7 @@ run-name: Build and Push Reese's Arch Toolbox
on: on:
push: push:
paths: paths:
- infrastructure/graduated/fedora/** - infrastructure/graduated/distoolbox/**
- .gitea/workflows/** - .gitea/workflows/**
schedule: schedule:
- cron: '@daily' - cron: '@daily'
@@ -23,16 +23,16 @@ jobs:
- name: Build and push Docker image - name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v5 uses: https://github.com/docker/build-push-action@v5
with: with:
context: ${{ gitea.workspace }}/infrastructure/graduated/fedora context: ${{ gitea.workspace }}/infrastructure/graduated/distoolbox
file: ${{ gitea.workspace }}/infrastructure/graduated/fedora/arch-toolbox.containerfile file: ${{ gitea.workspace }}/infrastructure/graduated/distoolbox/arch-toolbox.containerfile
push: true push: true
tags: "gitea.reeseapps.com/services/arch-toolbox:latest,gitea.reeseapps.com/services/arch-toolbox:${{gitea.sha}}" tags: "gitea.reeseapps.com/services/arch-toolbox:latest,gitea.reeseapps.com/services/arch-toolbox:${{gitea.sha}}"
no-cache: true no-cache: true
- name: Build and push AMD GPU Docker image - name: Build and push AMD GPU Docker image
uses: https://github.com/docker/build-push-action@v5 uses: https://github.com/docker/build-push-action@v5
with: with:
context: ${{ gitea.workspace }}/infrastructure/graduated/fedora context: ${{ gitea.workspace }}/infrastructure/graduated/distoolbox
file: ${{ gitea.workspace }}/infrastructure/graduated/fedora/arch-amdgpu-toolbox.containerfile file: ${{ gitea.workspace }}/infrastructure/graduated/distoolbox/arch-amdgpu-toolbox.containerfile
push: true push: true
tags: "gitea.reeseapps.com/services/arch-toolbox-amdgpu:latest,gitea.reeseapps.com/services/arch-toolbox-amdgpu:${{gitea.sha}}" tags: "gitea.reeseapps.com/services/arch-toolbox-amdgpu:latest,gitea.reeseapps.com/services/arch-toolbox-amdgpu:${{gitea.sha}}"
no-cache: true no-cache: true

2
.vscode/tasks.json vendored
View File

@@ -6,7 +6,7 @@
{ {
"label": "Build arch-toolbox", "label": "Build arch-toolbox",
"type": "shell", "type": "shell",
"command": "./infrastructure/graduated/fedora/arch-build.sh", "command": "./infrastructure/graduated/distoolbox/arch-build.sh",
"problemMatcher": [], "problemMatcher": [],
"group": { "group": {
"kind": "build", "kind": "build",

View File

@@ -2,13 +2,9 @@
A project to store homelab stuff. A project to store homelab stuff.
Just here for the Arch toolbox? Just here for the Arch distoolbox?
```bash [Arch Distoolbox](/infrastructure/graduated/distoolbox/distoolbox.md)
toolbox create -i gitea.reeseapps.com/services/arch-toolbox:latest
```
Find specific versions here: <https://gitea.reeseapps.com/services/-/packages/container/arch-toolbox/versions>
![Arch Toolbox Status](https://gitea.reeseapps.com/services/homelab/actions/workflows/build.yaml/badge.svg?branch=main) ![Arch Toolbox Status](https://gitea.reeseapps.com/services/homelab/actions/workflows/build.yaml/badge.svg?branch=main)

View File

@@ -0,0 +1,31 @@
#!/bin/bash
COMMAND_PREFIX=""
# We need to run the podman build on the host. If we're in a toolbox or a distrobox we need to
# spawn the process on the host. Fortunately both toolbox and distrobox provide ways for us to
# do this. We just need to check if "flatpak-spawn" (toolbox) or "distrobox-host-exec" (distrobox)
# exist in the PATH of our environment.
if command -v "distrobox-host-exec" &> /dev/null; then
echo "distrobox detected"
# In distrobox you can run "distrobox-host-exec ./path/to/this/script.sh"
COMMAND_PREFIX="distrobox-host-exec"
elif command -v "flatpak-spawn" &> /dev/null; then
echo "toolbox detected"
# In toolbox you can run "flatpak-spawn --host ./path/to/this/script.sh" to run this on the host
COMMAND_PREFIX="flatpak-spawn --host"
else
echo "already running as host"
fi
# Run the build for the CPU image
$COMMAND_PREFIX podman build \
--no-cache \
-t gitea.reeseapps.com/services/arch-toolbox:latest \
-f ./infrastructure/graduated/distoolbox/arch-toolbox.containerfile
# Run the build for the AMD gpu image
$COMMAND_PREFIX podman build \
--no-cache \
-t gitea.reeseapps.com/services/arch-toolbox-amdgpu:latest \
-f ./infrastructure/graduated/distoolbox/arch-amdgpu-toolbox.containerfile

View File

@@ -1,13 +1,14 @@
# Toolbox # Distoolbox
- [Toolbox](#toolbox) Distrobox? Toolbox? Whatever you want.
- [Reese's Arch Toolbox/Distrobox](#reeses-arch-toolboxdistrobox)
- [Distoolbox](#distoolbox)
- [Reese's Arch Distoolbox](#reeses-arch-distoolbox)
- [Using Reese's Arch Toolbox](#using-reeses-arch-toolbox) - [Using Reese's Arch Toolbox](#using-reeses-arch-toolbox)
- [CPU Image with Toolbox](#cpu-image-with-toolbox)
- [CPU Image with Distrobox](#cpu-image-with-distrobox) - [CPU Image with Distrobox](#cpu-image-with-distrobox)
- [AMD GPU Image with Toolbox](#amd-gpu-image-with-toolbox)
- [AMD GPU Image with Distrobox](#amd-gpu-image-with-distrobox) - [AMD GPU Image with Distrobox](#amd-gpu-image-with-distrobox)
- [Updating Reese's Arch Toolbox](#updating-reeses-arch-toolbox) - [CPU Image with Toolbox](#cpu-image-with-toolbox)
- [AMD GPU Image with Toolbox](#amd-gpu-image-with-toolbox)
- [Building Reese's Arch Toolbox](#building-reeses-arch-toolbox) - [Building Reese's Arch Toolbox](#building-reeses-arch-toolbox)
```bash ```bash
@@ -23,7 +24,7 @@ I'd recommend adding this alias to your `.bashrc` to make things easier
alias tbox='SHELL=zsh toolbox enter arch-toolbox-latest' alias tbox='SHELL=zsh toolbox enter arch-toolbox-latest'
``` ```
## Reese's Arch Toolbox/Distrobox ## Reese's Arch Distoolbox
I have a custom arch image based on the default arch-toolbox image. It offers: I have a custom arch image based on the default arch-toolbox image. It offers:
@@ -48,9 +49,17 @@ I have a custom arch image based on the default arch-toolbox image. It offers:
- jq - jq
- yq - yq
- imagemagick - imagemagick
- code
## Using Reese's Arch Toolbox ## Using Reese's Arch Toolbox
If you don't know whether to use distrobox or toolbox:
- If you're on Fedora, and you haven't used either, toolbox is built-in
- If you understand toolbox and you've never used distrobox, try distrobox
- If you understand distrobox and you've never used toolbox, try toolbox
- If you care what I use: distrobox
Copy the relevant aliases below into your `.bashrc`. Copy the relevant aliases below into your `.bashrc`.
Run `ntbox` the first time to create a new toolbox. Run `ntbox` the first time to create a new toolbox.
@@ -59,26 +68,6 @@ Run `tbox` anytime you want to enter the toolbox.
Run `rtbox` to delete 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 with Toolbox
```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"
```
### CPU Image with Distrobox ### CPU Image with Distrobox
Add the following to your `.bashrc` Add the following to your `.bashrc`
@@ -95,12 +84,48 @@ alias ntbox="distrobox create --name $TBOX_NAME --image $TBOX_REPO/$TBOX_IMAGE:$
alias tbox="distrobox enter $TBOX_NAME" alias tbox="distrobox enter $TBOX_NAME"
# Removes the toolbox # Removes the toolbox
alias rtbox="distrobox stop $TBOX_NAME --yes" alias rtbox="distrobox stop $TBOX_NAME --yes"
# Updates the toolbox ```
alias utbox="rtbox && ntbox"
### AMD GPU Image with Distrobox
This was built and tested for a Framework 16 with GPU module.
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="distrobox create --name $TBOX_NAME --image $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="distrobox enter $TBOX_NAME -- /bin/zsh"
# Removes the toolbox
alias rtbox="distrobox stop $TBOX_NAME --yes"
```
### CPU Image with Toolbox
```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"
``` ```
### AMD GPU Image with Toolbox ### AMD GPU Image with Toolbox
This was built and tested for a Framework 16 with GPU module.
Add the following to your `.bashrc` Add the following to your `.bashrc`
```bash ```bash
@@ -115,40 +140,6 @@ alias ntbox="toolbox create -i $TBOX_REPO/$TBOX_IMAGE:$TBOX_TAG"
alias tbox="SHELL=/bin/zsh toolbox enter $TBOX_NAME" alias tbox="SHELL=/bin/zsh toolbox enter $TBOX_NAME"
# Removes the toolbox # Removes the toolbox
alias rtbox="podman container stop $TBOX_NAME && podman container rm $TBOX_NAME" 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 with Distrobox
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="distrobox create --name $TBOX_NAME --image $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="distrobox enter $TBOX_NAME"
# Removes the toolbox
alias rtbox="distrobox stop $TBOX_NAME --yes"
# Updates the toolbox
alias utbox="rtbox && ntbox"
```
## 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 ## Building Reese's Arch Toolbox
@@ -164,14 +155,6 @@ podman build \
# Test with podman # Test with podman
podman run -it --rm gitea.reeseapps.com/services/arch-toolbox:latest 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 In vscode you can set this as your default build task for homelab and trigger it with

View File

@@ -1,11 +0,0 @@
#!/bin/bash
# Build latest image
# Note, in a toolbox you can run "flatpak-spawn --host ./path/to/this/script.sh"
podman build \
-t gitea.reeseapps.com/services/arch-toolbox:latest \
-f ./infrastructure/graduated/fedora/arch-toolbox.containerfile
podman build \
-t gitea.reeseapps.com/services/arch-toolbox-amdgpu:latest \
-f ./infrastructure/graduated/fedora/arch-amdgpu-toolbox.containerfile