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

@@ -1,14 +0,0 @@
FROM gitea.reeseapps.com/services/arch-toolbox:latest
# Install ROCM Drivers
RUN pacman -S --noconfirm rocm-hip-sdk rocm-opencl-sdk
# Install Ollama, an AI language model application.
RUN curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz && \
tar -C /usr -xzf ollama-linux-amd64.tgz && \
rm ollama-linux-amd64.tgz
# Install Ollama AMD drivers
RUN curl -L https://ollama.com/download/ollama-linux-amd64-rocm.tgz -o ollama-linux-amd64-rocm.tgz && \
tar -C /usr -xzf ollama-linux-amd64-rocm.tgz && \
rm ollama-linux-amd64-rocm.tgz

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

View File

@@ -1,27 +0,0 @@
# Default values for useradd(8)
#
# The SHELL variable specifies the default login shell on your
# system.
SHELL=/bin/zsh
# The default group for users
GROUP=users
# The default home directory.
HOME=/home
# The number of days after a password expires until the account is permanently
# disabled
INACTIVE=-1
# The default expire date
EXPIRE=
# The SKEL variable specifies the directory containing "skeletal" user files;
# in other words, files such as a sample .profile that will be copied to the
# new user's home directory when it is created.
SKEL=/etc/skel
# Defines whether the mail spool should be created while
# creating the account
CREATE_MAIL_SPOOL=no

View File

@@ -1 +0,0 @@
set-option -g default-shell "/bin/zsh"

View File

@@ -1,43 +0,0 @@
# 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
### Custom Commands and Aliases ###
# Local bin PATH
export PATH="$HOME/.local/bin:$HOME/.local/scripts:$PATH"
# 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
# Go puts binaries here
export PATH="$PATH:$(go env GOBIN):$(go env GOPATH)/bin"
# Nodejs Binaries
export npm_config_prefix="$HOME/.local"
# Pyenv
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Calculate all folder sizes in current dir
alias {dudir,dud}='du -h --max-depth 1 | sort -h'
# Calculate all file sizes in current dir
alias {dufile,duf}='ls -lhSr'

View File

@@ -1,124 +0,0 @@
# Dockerfile for an Arch Linux Toolbox environment with a variety of development and utility tools.
# Base image using the latest version from quay.io/toolbx/arch-toolbox.
FROM docker.io/archlinux:latest
########################
##### Pacman #####
########################
# Enable multilib support by appending it to /etc/pacman.conf.
RUN tee -a /etc/pacman.conf <<EOF
[multilib]
Include = /etc/pacman.d/mirrorlist
EOF
# Set the architecture for Pacman manually to x86_64 since automatic detection might not work properly.
RUN sed -i 's/^Architecture = auto/Architecture = x86_64/' /etc/pacman.conf
# Sync repository databases.
RUN pacman -Syu --noconfirm
# Install a variety of commonly used tools and utilities using Pacman.
RUN pacman -S --noconfirm \
# A powerful shell with syntax highlighting, autosuggestions, and more.
zsh grml-zsh-config zsh-syntax-highlighting zsh-autosuggestions \
# Utility to find which packages own files or directories in the system.
pkgfile \
# Advanced text editor for code editing and other tasks.
vim \
# DNS name resolver
bind \
# Network bandwidth measuring tool.
iperf3 \
# Command-line interface for managing Kubernetes clusters.
kubectl \
# Package manager and deployment tool for Kubernetes.
helm \
# Utility to monitor real-time network usage of processes.
nethogs \
# Python programming language interpreter, pip package manager, and pipx for isolated package management.
python python-pip python-pipx \
# DevOps configuration management tool.
ansible \
# Terminal multiplexer.
tmux \
# Multimedia player with support for a wide range of codecs and file formats.
ffmpeg \
# Microsoft Windows compatibility layer.
wine \
# Container engine providing an interface that works similarly to Docker but is container format-agnostic.
podman \
# Archive utility similar to GNU tar, used to package files into single archive files.
unzip \
# An open source version of cat(1) with syntax highlighting and Git integration.
bat \
# A terminal activity monitor (top clone).
btop \
# Command-line JSON processor.
jq \
# YAML-based configuration-as-code tool for command-line interfaces written in Go, Rust, Python, and more.
yq \
# An image manipulation software suite based on ImageMagick.
imagemagick \
# Cross-platform JavaScript runtime built for developing the server-side of web applications.
nodejs npm \
# The Go programming language environment including a toolchain (gc) and libraries.
go \
# Rust package manager and compiler installation utility.
rust rustup \
# Distributed version control system, Git extension that adds support for large files like multimedia assets.
git-lfs \
# Provides traditional network tools such as ifconfig, netstat, hostname, etc., in a single package.
net-tools \
# A cross-platform system monitor that works similarly to htop(1).
glances \
# Network manager tool
networkmanager \
# Document conversion tool and markup language converter.
pandoc \
# Comprehensive LaTeX distribution for high-quality typesetting of documents.
texlive-latex texlive-latexextra texlive-latexrecommended texlive-binextra texlive-fontsrecommended texlive-fontsextra \
# Visual Studio Code editor
code \
# Python static type checker and code formatter.
ruff \
# Generate strong passwords.
pwgen \
# Custom keyboard c onfiguration
qmk \
# libmemcachd for python projects
libmemcached-awesome \
# For distrobox
systemd
########################
##### Extra Apps #####
########################
# Install UV, a tool for managing Python environments.
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# Install AWS CLI version 2.
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip -qq awscliv2.zip && \
./aws/install && \
rm awscliv2.zip && \
rm -rf aws
# Install yt-dlp, a command-line program for downloading YouTube videos.
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/youtube-dlp && \
chmod a+rx /usr/local/bin/youtube-dlp
####################
##### COPIES #####
####################
# Copy the zshrc.local configuration file to the container.
COPY arch-toolbox-supporting-files/zshrc /etc/zsh/zshrc.local
# Copy tmux.conf to configure tmux in the container.
COPY arch-toolbox-supporting-files/arch-toolbox-tmux.conf /etc/tmux.conf
# Copy useradd to set default shell
COPY arch-toolbox-supporting-files/arch-toolbox-default-useradd /etc/default/useradd

View File

@@ -1 +0,0 @@
1

View File

@@ -1,200 +0,0 @@
# Toolbox
- [Toolbox](#toolbox)
- [Reese's Arch Toolbox/Distrobox](#reeses-arch-toolboxdistrobox)
- [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)
- [AMD GPU Image with Toolbox](#amd-gpu-image-with-toolbox)
- [AMD GPU Image with Distrobox](#amd-gpu-image-with-distrobox)
- [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/Distrobox
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 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
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="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"
```
### AMD GPU Image with Toolbox
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"
```
### 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
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
}
}
]
}
```