switch to docker-based build script with the assumption the user will use podman as backend if needed
This commit is contained in:
@@ -2,30 +2,22 @@
|
||||
|
||||
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
|
||||
# If you haven't already, read up on setting the docker context to use podman as the backend.
|
||||
# TL;DR
|
||||
# systemctl --user enable --now podman.socket
|
||||
# docker context create podman --docker host=unix://$XDG_RUNTIME_DIR/podman/podman.sock
|
||||
# docker context use podman
|
||||
|
||||
# Run the build for the CPU image
|
||||
$COMMAND_PREFIX podman build \
|
||||
--no-cache \
|
||||
docker build \
|
||||
-t gitea.reeseapps.com/services/arch-toolbox:latest \
|
||||
-f ./infrastructure/graduated/distoolbox/arch-toolbox.containerfile
|
||||
-f ./infrastructure/graduated/distoolbox/arch-toolbox.containerfile \
|
||||
--load \
|
||||
./infrastructure/graduated/distoolbox
|
||||
|
||||
# Run the build for the AMD gpu image
|
||||
$COMMAND_PREFIX podman build \
|
||||
--no-cache \
|
||||
docker build \
|
||||
-t gitea.reeseapps.com/services/arch-toolbox-amdgpu:latest \
|
||||
-f ./infrastructure/graduated/distoolbox/arch-amdgpu-toolbox.containerfile
|
||||
-f ./infrastructure/graduated/distoolbox/arch-amdgpu-toolbox.containerfile \
|
||||
--load \
|
||||
./infrastructure/graduated/distoolbox
|
||||
@@ -49,6 +49,8 @@ RUN pacman -S --noconfirm \
|
||||
wine \
|
||||
# Container engine providing an interface that works similarly to Docker but is container format-agnostic.
|
||||
podman \
|
||||
# Docker compatibility. We won't be using the daemon unless you want to.
|
||||
docker docker-compose docker-buildx \
|
||||
# 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.
|
||||
@@ -102,9 +104,6 @@ RUN pacman -S --noconfirm \
|
||||
##### 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 && \
|
||||
|
||||
Reference in New Issue
Block a user