Diferencia entre revisiones de «Instalar Docker»
Ir a la navegación
Ir a la búsqueda
(No se muestran 14 ediciones intermedias del mismo usuario) | |||
Línea 1: | Línea 1: | ||
= GNU/Linux = | == GNU/Linux == | ||
== | === Debian === | ||
=== Fedora 38 Workstation === | ==== Debian 12 Bullseye ==== | ||
cd ~ | |||
sudo apt update | |||
sudo apt install ca-certificates curl gnupg apt-transport-https gpg | |||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg | |||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" |sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |||
sudo apt update | |||
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin | |||
sudo apt autoremove && sudo apt autoclean && sudo apt clean | |||
===== Permisos ===== | |||
sudo usermod -aG docker $USER | |||
newgrp docker | |||
===== Verificar ===== | |||
sudo systemctl is-active docker | |||
Sale por pantalla: | |||
active | |||
=== Fedora === | |||
==== Fedora 38 Workstation ==== | |||
sudo dnf install docker | sudo dnf install docker | ||
==== Levantar servicio ==== | ===== Levantar servicio ===== | ||
sudo systemctl start docker | sudo systemctl start docker | ||
==== Verificar estado ==== | ===== Verificar estado ===== | ||
sudo systemctl status docker | sudo systemctl status docker | ||
===== Permisos ===== | |||
Se puede dar permisos de utilización de docker a un usuario en especifico. En nuestro ejemplo daríamos permisos al usuario proyectosbeta. | |||
sudo groupadd docker | |||
sudo usermod -aG docker proyectosbeta | |||
sudo chown root:docker /var/run/docker.sock | |||
sudo systemctl restart docker | |||
sudo chmod 777 /var/run/docker.sock | |||
=== Ubuntu === | |||
==== Ubuntu 24.04 LTS ==== | |||
# Add Docker's official GPG key: | |||
sudo apt update | |||
sudo apt install ca-certificates curl | |||
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 | |||
# Add the repository to Apt sources: | |||
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 update | |||
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |||
sudo apt autoremove && sudo apt clean && sudo apt autoclean | |||
===== Permisos ===== | |||
sudo usermod -aG docker proyectosbeta | |||
sudo chown root:docker /var/run/docker.sock | |||
sudo systemctl restart docker | |||
sudo chmod 777 /var/run/docker.sock | |||
===== Verificar ===== | |||
docker run hello-world |
Revisión actual - 08:33 10 nov 2024
GNU/Linux
Debian
Debian 12 Bullseye
cd ~ sudo apt update sudo apt install ca-certificates curl gnupg apt-transport-https gpg curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" |sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin sudo apt autoremove && sudo apt autoclean && sudo apt clean
Permisos
sudo usermod -aG docker $USER newgrp docker
Verificar
sudo systemctl is-active docker
Sale por pantalla:
active
Fedora
Fedora 38 Workstation
sudo dnf install docker
Levantar servicio
sudo systemctl start docker
Verificar estado
sudo systemctl status docker
Permisos
Se puede dar permisos de utilización de docker a un usuario en especifico. En nuestro ejemplo daríamos permisos al usuario proyectosbeta.
sudo groupadd docker sudo usermod -aG docker proyectosbeta sudo chown root:docker /var/run/docker.sock sudo systemctl restart docker sudo chmod 777 /var/run/docker.sock
Ubuntu
Ubuntu 24.04 LTS
# Add Docker's official GPG key: sudo apt update sudo apt install ca-certificates curl 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
# Add the repository to Apt sources: 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 update sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo apt autoremove && sudo apt clean && sudo apt autoclean
Permisos
sudo usermod -aG docker proyectosbeta sudo chown root:docker /var/run/docker.sock sudo systemctl restart docker sudo chmod 777 /var/run/docker.sock
Verificar
docker run hello-world