Add 01-arch_install.sh

This commit is contained in:
RomanNum3ral 2026-03-16 14:22:00 +00:00
parent 0b9e624394
commit 9d118e3fde
1 changed files with 40 additions and 0 deletions

40
01-arch_install.sh Normal file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
# Update system and install Docker stack from official Arch repos
sudo pacman -Syu --noconfirm
sudo pacman -S --needed --noconfirm \
ca-certificates \
curl \
docker \
docker-buildx \
docker-compose
# Enable and start Docker daemon
sudo systemctl enable --now docker.service
# Allow current user to run docker without sudo after next login
if ! id -nG "$USER" | grep -qw docker; then
sudo usermod -aG docker "$USER"
fi
# Install bash aliases in a user-owned, Arch-friendly way
if [[ -f .bash_aliases ]]; then
install -Dm644 .bash_aliases "$HOME/.bash_aliases"
# Ensure ~/.bashrc loads ~/.bash_aliases
if [[ -f "$HOME/.bashrc" ]] && ! grep -qF '.bash_aliases' "$HOME/.bashrc"; then
cat >> "$HOME/.bashrc" <<'EOF'
# Load user aliases if present
if [[ -f ~/.bash_aliases ]]; then
. ~/.bash_aliases
fi
EOF
fi
fi
echo
echo "Done."
echo "Docker is installed and the service is running."
echo "Log out and back in before using docker without sudo."