0Pricing
Docker & Kubernetes for Developers · Ders

Docker ağ türlerini anlama

Köprü, ana makine ve örtüşen ağ gibi farklı Docker ağ sürücülerini ve bunların konteyner iletişimindeki kullanım alanlarını inceleyin.

Docker ağ türlerini anlama, CoddyKit'te ücretsiz bir Docker & Kubernetes for Developers dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Docker & Kubernetes for Developers öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Docker & Kubernetes for Developers kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Intro to Docker Networks

Welcome to Docker networking! Containers need to talk to each other and the outside world. Docker networks make this possible.

Understanding network types is key to building robust and scalable applications. Let's dive in!

The Default Bridge Network

When you first install Docker, it creates a default bridge network named bridge. Unless specified, all new containers connect to this network.

  • Containers on the same default bridge can communicate via IP address.
  • They are isolated from the host machine's network.

Inspecting Default Bridge

You can see the default bridge network and its details using Docker commands. Try running these:

docker network ls
docker network inspect bridge

Custom Bridge Networks

While the default bridge works, custom bridge networks offer significant advantages:

  • Isolation: Better segmentation for different applications.
  • DNS Resolution: Containers can communicate by name, not just IP.
  • Portability: Easier to manage complex setups.

Creating a Custom Bridge Network

Let's create our own custom bridge network. This network will be isolated and provide DNS resolution for containers connected to it.

docker network create my-custom-app-net

Connect Containers to Custom Network

Now, let's run two containers on our my-custom-app-net and see them talk to each other using their names. This is a huge benefit!

docker run -d --name web1 --network my-custom-app-net nginx
docker run -it --rm --network my-custom-app-net alpine ping -c 2 web1

The 'Host' Network Driver

The host network driver is different. It removes network isolation between the container and the Docker host.

A container using the host network shares the host's network stack directly. This means:

  • No port mapping is needed.
  • The container uses the host's IP address.

Host Network Use Cases

The host network can be useful for specific scenarios:

  • Performance: Minimizes networking overhead.
  • Monitoring: Accessing host-level network interfaces directly.

However, it reduces isolation and can lead to port conflicts if not managed carefully.

docker run -it --rm --network host alpine sh

Overlay Networks for Swarm

When you start dealing with multiple Docker hosts (machines), you need a way for containers on different hosts to communicate. This is where overlay networks come in.

Overlay networks are crucial for Docker Swarm, allowing services to communicate seamlessly across an entire cluster.

Overlay Network Advantages

Overlay networks provide:

  • Multi-host communication: Containers on different physical machines can talk.
  • Service Discovery: Integrated DNS for services across the swarm.
  • Load Balancing: Distributes traffic among service replicas.

They abstract away the underlying physical network complexity.

Network Type Quiz

Test your knowledge of Docker network types!

Network Types Recap

Great job! You've learned about the main Docker network types:

  • Bridge (Default & Custom): For single-host container communication. Custom bridges add isolation and DNS.
  • Host: For containers that need direct access to the host's network stack.
  • Overlay: For multi-host container communication in a Docker Swarm.

Choosing the right network type is vital for your application's architecture. Next, we'll learn how to configure them!

Sıkça Sorulan Sorular

“Docker ağ türlerini anlama” dersi ücretsiz mi?

Evet — “Docker ağ türlerini anlama” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Docker & Kubernetes for Developers kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Docker & Kubernetes for Developers kursu toplamda 4 dersten oluşur.

“Docker ağ türlerini anlama” dersinde ne öğreneceğim?

Köprü, ana makine ve örtüşen ağ gibi farklı Docker ağ sürücülerini ve bunların konteyner iletişimindeki kullanım alanlarını inceleyin. Docker & Kubernetes for Developers ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Docker & Kubernetes for Developers öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Docker & Kubernetes for Developers, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“Docker ağ türlerini anlama” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Docker & Kubernetes for Developers dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Docker & Kubernetes for Developers dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Docker ağ türlerini anlama
  2. Konteyner ağlarını yapılandırma
  3. Birimlerle verilerin kalıcı tutulması
  4. Docker Compose Ağlarıyla Kapsayıcıları Bağlama
← Docker & Kubernetes for Developers Sayfasına Dön