- Version logged after [PASS] (not before) across all scripts - Pre-cache brew package lists with log_info progress - Read brew version from git describe cache (skip Ruby startup) - Batch mise use -g calls (single invocation for all tools) - Replace mise verify step with mise ls --current - Parallel vim plugin pulls - Skip donut compile when binary is fresh - Pre-check macOS defaults before writing (skip fsync when unchanged) - Pre-check dock state before dockutil calls - Remove redundant 'already installed' skip logs - Remove meetingbar and wispr-flow install scripts - Renumber scripts to fill gaps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
61 lines
1.9 KiB
Bash
Executable File
61 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Description:
|
|
# (macOS) Install Docker.
|
|
# (Linux) Setup Docker.
|
|
#
|
|
|
|
# skip if SKIP_DOCKER_CONFIG is set
|
|
[[ -n "$SKIP_DOCKER_CONFIG" ]] && { log_skip "SKIP_DOCKER_CONFIG is set"; return 0; }
|
|
|
|
# skip if in WSL
|
|
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
|
log_skip "Running in WSL"
|
|
return 0
|
|
fi
|
|
|
|
# skip if in Codespaces
|
|
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
|
|
|
|
# skip on macOS
|
|
[[ "$DOTS_OS" == "macos" ]] && { log_skip "macOS"; return 0; }
|
|
|
|
if ! command -v docker &> /dev/null; then
|
|
case "$DOTS_PKG" in
|
|
apt)
|
|
sudo install -m 0755 -d /etc/apt/keyrings
|
|
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
|
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
|
|
|
echo \
|
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
|
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
;;
|
|
pacman)
|
|
sudo pacman -S --noconfirm --needed docker docker-buildx docker-compose
|
|
;;
|
|
*)
|
|
log_warn "Skipping Docker install: no supported package manager found"
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
readonly docker_group="docker"
|
|
if ! grep -q "$docker_group" /etc/group; then
|
|
log_info "Adding docker group"
|
|
sudo groupadd "$docker_group"
|
|
fi
|
|
|
|
if ! groups "$USER" | grep -q "\b$docker_group\b"; then
|
|
log_info "Adding user to docker group"
|
|
sudo usermod -aG docker "$USER"
|
|
fi
|
|
|
|
log_pass "Docker configured"
|
|
docker --version | log_quote
|