DEV Community

Rümeysa Öz for Açıklab

Posted on

1

Docker ve Docker Compose Kurulumu (Ubuntu 20.04)

1. Docker Kurulumu

Resmi Ubuntu deposunda Docker kurulum paketi en son sürüm olmayabilir. En son sürümü aldığımızdan emin olmak için Docker'ı resmi Docker deposundan kuracağız. Bunu yapmak için yeni bir paket kaynağı ekleyeceğiz, indirmelerin geçerli olduğundan emin olmak için Docker'dan GPG anahtarını ekleyeceğiz ve ardından paketi kuracağız.

  • İlk olarak, mevcut paket listenizi güncelleyin:


 sudo apt update


Enter fullscreen mode Exit fullscreen mode
  • Ardından, apt'nin HTTPS üzerinden paketleri kullanmasına izin veren birkaç önkoşul paketi yükleyin:


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


Enter fullscreen mode Exit fullscreen mode
  • Sonrasında, resmi Docker deposu için GPG anahtarını sisteminize ekleyin:


 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -


Enter fullscreen mode Exit fullscreen mode
  • Docker deposunu APT aynaklarına ekleyin:


 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"


Enter fullscreen mode Exit fullscreen mode
  • Bu, paket veritabanımızı yeni eklenen depodaki Docker paketleriyle de güncelleyecektir.

  • Varsayılan Ubuntu reposu yerine Docker reposundan yüklemek üzere olduğunuzdan emin olun:



 apt-cache policy docker-ce


Enter fullscreen mode Exit fullscreen mode
  • Docker sürüm numarası farklı olsa da çıktıyı şu şekilde göreceksiniz:

Image description

  • Docker-ce'nin yüklü olmadığına, ancak kurulum adayının Ubuntu 20.04 için Docker deposundan olduğuna dikkat edin.

  • Son olarak, Docker'ı yükleyin:



 sudo apt install docker-ce


Enter fullscreen mode Exit fullscreen mode
  • Docker şimdi kurulmalı, arka plan programı başlatılmalı ve işlemin önyüklemede başlaması etkinleştirilmelidir.

  • Çalışıp çalışmadığını kontrol edin:



 sudo systemctl status docker


Enter fullscreen mode Exit fullscreen mode
  • Çıktı, hizmetin aktif ve çalıştığını gösteren aşağıdakine benzer olmalıdır:

Image description

2. Docker Compose Kurulumu

  • Aşağıdaki komut yürütülebilir dosyayı /usr /local/bin/docker-compose adresine kaydedecek ve bu da bu bu yazılımı genel olarak docker-compose olarak erişilebilir hale getirecektir:


 sudo curl -L -k "https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose


Enter fullscreen mode Exit fullscreen mode
  • Ardından, docker-compose komutunun yürütülebilir olması için doğru izinleri ayarlayın:


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


Enter fullscreen mode Exit fullscreen mode
  • Kurulumun başarılı olduğunu doğrulamak için şu komutu çalıştırabilirsiniz:


 docker-compose --version


Enter fullscreen mode Exit fullscreen mode
  • Buna benzer bir çıktı görecesiniz:

Image description

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay