Howto docker

From Vidalinux Wiki
Revision as of 19:44, 18 January 2023 by Mandulete1 (talk | contribs)
Jump to navigation Jump to search

install docker archlinux

install docker on archlinux:

pacman -Syu docker docker-compose --noconfirm

install docker ubuntu/debian

install dependencies:

sudo apt update
sudo apt -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common

import docker gpg key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

add docker repository:

sudo add-apt-repository \
  "deb [arch=amd64] https://download.docker.com/linux/debian \
  $(lsb_release -cs) \
  stable"

update package index and install docker:

sudo apt update && sudo apt update && apt install -y docker-ce docker-ce-cli containerd.io

install docker-compose:

curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url  | grep docker-compose-linux-x86_64 | grep -v .sha256 | cut -d '"' -f 4 | wget -qi - -O /usr/local/bin/docker-compose 

change file permissions:

chmod +x /usr/local/bin/docker-compose

= redhat and others

install repo:

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

install docker latest version:

dnf install docker-ce --nobest -y

start and enable docker service:

systemctl start docker
systemctl enable docker

verify installed docker version:

docker --version

install docker-compose:

curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

fix permissions:

chmod +x /usr/local/bin/docker-compose

verify docker-compose version:

docker-compose --version