Agregar modulo de instalacion de Docker
- modules/docker.sh: instala Docker Engine (docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, docker-compose-plugin) via repositorio apt oficial de Docker; agrega el usuario al grupo docker para operar sin sudo; instala Lazydocker en ~/.local/bin/ desde la ultima release de GitHub - config/modules: docker corre despues de registry y antes de thunderbird - CLAUDE.md y README.md: documentan el nuevo modulo en la tabla de orden de ejecucion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,7 @@ Current modules in execution order:
|
|||||||
- `bootstrap` — installs `yq` and `age` (required by all other modules)
|
- `bootstrap` — installs `yq` and `age` (required by all other modules)
|
||||||
- `ssh` — decrypts `secrets/sshKeys.tar.gz.age` with `age` and installs keys into `~/.ssh`
|
- `ssh` — decrypts `secrets/sshKeys.tar.gz.age` with `age` and installs keys into `~/.ssh`
|
||||||
- `registry` — reads `config/registry.yaml` and applies every entry (packages, dotfiles, services, drivers, audio)
|
- `registry` — reads `config/registry.yaml` and applies every entry (packages, dotfiles, services, drivers, audio)
|
||||||
|
- `docker` — installs Docker Engine, Docker Compose plugin, adds user to `docker` group, and installs Lazydocker
|
||||||
- `thunderbird` — installs Thunderbird (snap) and restores profile from `secrets/thunderbirdProfile.zip`
|
- `thunderbird` — installs Thunderbird (snap) and restores profile from `secrets/thunderbirdProfile.zip`
|
||||||
- `claudeCode` — configures the Anthropic apt repository and installs `claude-code`
|
- `claudeCode` — configures the Anthropic apt repository and installs `claude-code`
|
||||||
- `easyEffects` — restores EasyEffects config and presets from `secrets/easyEffectsConfig.zip`
|
- `easyEffects` — restores EasyEffects config and presets from `secrets/easyEffectsConfig.zip`
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ El orden está definido en `config/modules` (un módulo por línea, `#` para com
|
|||||||
| `bootstrap` | Instala `yq` y `age` (requeridos por los demás módulos) |
|
| `bootstrap` | Instala `yq` y `age` (requeridos por los demás módulos) |
|
||||||
| `ssh` | Descifra e instala claves SSH en `~/.ssh` |
|
| `ssh` | Descifra e instala claves SSH en `~/.ssh` |
|
||||||
| `registry` | Aplica todo lo declarado en `config/registry.yaml` |
|
| `registry` | Aplica todo lo declarado en `config/registry.yaml` |
|
||||||
|
| `docker` | Instala Docker Engine, Docker Compose, agrega el usuario al grupo `docker` e instala Lazydocker |
|
||||||
| `thunderbird` | Instala Thunderbird (snap) y restaura el perfil |
|
| `thunderbird` | Instala Thunderbird (snap) y restaura el perfil |
|
||||||
| `claudeCode` | Configura el repositorio apt de Anthropic e instala `claude-code` |
|
| `claudeCode` | Configura el repositorio apt de Anthropic e instala `claude-code` |
|
||||||
| `easyEffects` | Restaura configuración y presets de EasyEffects |
|
| `easyEffects` | Restaura configuración y presets de EasyEffects |
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
bootstrap
|
bootstrap
|
||||||
ssh
|
ssh
|
||||||
registry
|
registry
|
||||||
|
docker
|
||||||
thunderbird
|
thunderbird
|
||||||
claudeCode
|
claudeCode
|
||||||
easyEffects
|
easyEffects
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
source "$stpRoot/lib/log.sh"
|
||||||
|
source "$stpRoot/lib/utils.sh"
|
||||||
|
|
||||||
|
readonly dockerKeyring="/etc/apt/keyrings/docker.asc"
|
||||||
|
readonly dockerSources="/etc/apt/sources.list.d/docker.list"
|
||||||
|
|
||||||
|
dockerIsInstalled() {
|
||||||
|
util::cmdExists docker
|
||||||
|
}
|
||||||
|
|
||||||
|
dockerRepositoryIsConfigured() {
|
||||||
|
[[ -f "$dockerSources" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
userIsInDockerGroup() {
|
||||||
|
groups "$USER" | grep -qw docker
|
||||||
|
}
|
||||||
|
|
||||||
|
lazydockerIsInstalled() {
|
||||||
|
util::cmdExists lazydocker
|
||||||
|
}
|
||||||
|
|
||||||
|
latestGithubReleaseTag() {
|
||||||
|
local repository="$1"
|
||||||
|
curl -fsSL "https://api.github.com/repos/${repository}/releases/latest" \
|
||||||
|
| grep '"tag_name"' \
|
||||||
|
| cut -d'"' -f4
|
||||||
|
}
|
||||||
|
|
||||||
|
addDockerSigningKey() {
|
||||||
|
sudo install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
|
||||||
|
| sudo tee "$dockerKeyring" > /dev/null
|
||||||
|
sudo chmod a+r "$dockerKeyring"
|
||||||
|
log::ok "Clave GPG de Docker instalada"
|
||||||
|
}
|
||||||
|
|
||||||
|
addDockerRepository() {
|
||||||
|
local ubuntuCodename
|
||||||
|
ubuntuCodename="$(. /etc/os-release && echo "$VERSION_CODENAME")"
|
||||||
|
echo "deb [arch=amd64 signed-by=${dockerKeyring}] https://download.docker.com/linux/ubuntu ${ubuntuCodename} stable" \
|
||||||
|
| sudo tee "$dockerSources" > /dev/null
|
||||||
|
sudo apt-get update -qq
|
||||||
|
log::ok "Repositorio Docker configurado para Ubuntu ${ubuntuCodename}"
|
||||||
|
}
|
||||||
|
|
||||||
|
installDockerPackages() {
|
||||||
|
sudo apt-get install -y \
|
||||||
|
docker-ce \
|
||||||
|
docker-ce-cli \
|
||||||
|
containerd.io \
|
||||||
|
docker-buildx-plugin \
|
||||||
|
docker-compose-plugin
|
||||||
|
log::ok "Docker Engine y Docker Compose instalados"
|
||||||
|
}
|
||||||
|
|
||||||
|
addUserToDockerGroup() {
|
||||||
|
sudo usermod -aG docker "$USER"
|
||||||
|
log::ok "Usuario $USER agregado al grupo docker"
|
||||||
|
log::info "Cerrá sesión y volvé a entrar para usar Docker sin sudo"
|
||||||
|
}
|
||||||
|
|
||||||
|
installLazydocker() {
|
||||||
|
local version versionNumber temporaryDirectory
|
||||||
|
version="$(latestGithubReleaseTag "jesseduffield/lazydocker")"
|
||||||
|
versionNumber="${version#v}"
|
||||||
|
temporaryDirectory="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$temporaryDirectory"' RETURN
|
||||||
|
curl -fsSL \
|
||||||
|
"https://github.com/jesseduffield/lazydocker/releases/download/${version}/lazydocker_${versionNumber}_Linux_x86_64.tar.gz" \
|
||||||
|
| tar -xz -C "$temporaryDirectory"
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
mv "$temporaryDirectory/lazydocker" "$HOME/.local/bin/lazydocker"
|
||||||
|
log::ok "Lazydocker ${version} instalado en ~/.local/bin/"
|
||||||
|
}
|
||||||
|
|
||||||
|
if dockerIsInstalled; then
|
||||||
|
log::info "Docker ya instalado: $(docker --version)"
|
||||||
|
else
|
||||||
|
log::info "Instalando Docker Engine..."
|
||||||
|
util::requireSudo
|
||||||
|
if ! dockerRepositoryIsConfigured; then
|
||||||
|
addDockerSigningKey
|
||||||
|
addDockerRepository
|
||||||
|
fi
|
||||||
|
installDockerPackages
|
||||||
|
fi
|
||||||
|
|
||||||
|
if userIsInDockerGroup; then
|
||||||
|
log::info "Usuario $USER ya en el grupo docker"
|
||||||
|
else
|
||||||
|
util::requireSudo
|
||||||
|
addUserToDockerGroup
|
||||||
|
fi
|
||||||
|
|
||||||
|
if lazydockerIsInstalled; then
|
||||||
|
log::info "Lazydocker ya instalado"
|
||||||
|
else
|
||||||
|
installLazydocker
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user