Difference between revisions of "Ubuntu docker-compose.yml example"

From wikieduonline
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Draft}}
+
Running two [[Ubuntu]] instances:
  
 
+
  version: "3.3"
  version: "3.9"
+
 +
[[services:]]
 +
  Ubuntu1:
 +
        [[docker-compose.yml: image:|image]]: ubuntu
 +
        container_name: Ubuntu_container_1
 +
        hostname: Ubuntu_container_1
 +
        restart: always
 +
        [[stdin_open:]] true # [[docker run -i]]
 +
        [[tty:]] true        # [[docker run -t]]
 
   
 
   
services:
+
  Ubuntu2:
  Ubuntu:
+
         image: ubuntu
         [[image]]: ubuntu
+
         container_name: Ubuntu_container_2
         container_name: Ubuntu_container_1
+
        hostname: Ubuntu_container_2
 
         restart: always
 
         restart: always
 
+
        stdin_open: true # docker run -i
 +
        tty: true        # docker run -t
  
  
 
== Related terms ==
 
== Related terms ==
 
* [[Docker-compose.yml examples]]
 
* [[Docker-compose.yml examples]]
 
+
* <code>[[docker ps]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 16:26, 16 July 2024

Running two Ubuntu instances:

version: "3.3"

services:
 Ubuntu1:
       image: ubuntu
       container_name: Ubuntu_container_1
       hostname: Ubuntu_container_1
       restart: always
       stdin_open: true # docker run -i
       tty: true        # docker run -t

 Ubuntu2:
       image: ubuntu
       container_name: Ubuntu_container_2
       hostname: Ubuntu_container_2
       restart: always
       stdin_open: true # docker run -i
       tty: true        # docker run -t


Related terms[edit]

See also[edit]

Advertising: