LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 03-29-2024, 06:41 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 556

Rep: Reputation: 10
Post Networks vs docker network command


Hello,
I have two YAML files like below:
Code:
version: '3.9'
  networks:
    PHP:
      driver: bridge
services:
        php-fpm:
...
And:
Code:
version: '3.9'
networks:
  Apache:
    external: true
    name: My_Net
services:
        httpd:
...
These containers can ping each other. If I remove the networks section from the above counters and use the following commands instead, are the two tasks the same?
Code:
# docker network create My_Net
# docker network connect My_Net php-fpm
# docker network connect My_Net httpd
I would be grateful if someone could clarify this issue.

Cheers.
 
Old 03-30-2024, 08:17 AM   #2
Jason.nix
Member
 
Registered: Feb 2023
Posts: 556

Original Poster
Rep: Reputation: 10
Hello,
Yes, it is the same.

Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Difference between docker.io, docker-cd, and Docker Desktop LXer Syndicated Linux News 0 08-15-2022 05:39 PM
LXer: How to Use the Docker Run Command to Launch Docker Containers LXer Syndicated Linux News 0 12-30-2020 05:10 AM
LXer: How to Use the Docker Exec Command to Interact with Your Docker Containers LXer Syndicated Linux News 0 12-25-2020 03:21 AM
LXer: Java EE Servers as Nova-Docker Containers && RDO Mitaka External vlan networks LXer Syndicated Linux News 0 05-21-2016 01:35 AM
I am bridging 2 networks, but only want the Bridge machine to see both networks. themrrobert Linux - Networking 1 02-17-2009 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration