DEV Community

JPL
JPL

Posted on

Instalacija Dockera

  1. INSTALACIJA DOCKER REPO

Na novoj masini potrebno je za prvi put postaviti Docker repozitorij, nakon toga mozemo da instaliramo i radimo update Dockera iz repozitorija.

Deinstalacija starih verzija Dockera

    sudo apt-get remove docker docker-engine docker.io containerd runc
Enter fullscreen mode Exit fullscreen mode

*Instalacija koristeci apt direktorij *

1.
a) Update apt paketa index

    sudo apt-get update

b) Instalacija paketa dozvoljavajuci apt da koristi repozitorij preko HTTPS

    sudo apt-get install ca-certificates curl gnupg
Enter fullscreen mode Exit fullscreen mode

instalacija-paketa-https

  1. Dodavanje GPG official kljuca za Docker:

    sudo install -m 0755 -d /etc/apt/keyrings
    
    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    
    sudo chmod a+r /etc/apt/keyrings/docker.gpg
    
  2. Postavljanje repozitorija

    echo \
     "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
    "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    

Nakon ove komande nema nikakvog ispisa.

2. INSTALACIJA DOCKER ENGINA

  1. Update paketa

    sudo apt-get update 
    
  2. Instalacija Docker engina, containerd i Docker COmpose

    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    
  3. Verifikovati da je Docker engin uspjesno instaliran, pokretajuci komandu hell-world, tj. image.

    sudo docker run hello-world
    

hello-world-run-docker

Top comments (0)